Skip to content

Instantly share code, notes, and snippets.

@DaGenix
Created February 10, 2014 02:04
Show Gist options
  • Save DaGenix/8909133 to your computer and use it in GitHub Desktop.
Save DaGenix/8909133 to your computer and use it in GitHub Desktop.
this should compile, right?
pub trait Even {
fn say(&self);
}
impl <'a, E: Even> Even for &'a mut E {
fn say(&self) { }
}
pub trait Odd {
fn say(&self);
}
fn print_odd<O: Odd>(o: &mut O) {
o.say();
}
fn main() { }
@DaGenix
Copy link
Author

DaGenix commented Feb 10, 2014

Fails with:

foo9.rs:14:5: 14:12 error: failed to find an implementation of trait Even for O
foo9.rs:14     o.say();
               ^~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment