Skip to content

Instantly share code, notes, and snippets.

@Dretch
Created March 29, 2013 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dretch/5273434 to your computer and use it in GitHub Desktop.
Save Dretch/5273434 to your computer and use it in GitHub Desktop.
without the <'self> then rustc complains that 'self must be declared
trait MyTrait {
fn foo(&self);
}
impl <'self> MyTrait for &'self str {
fn foo(&self) {}
}
fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment