Skip to content

Instantly share code, notes, and snippets.

@zokier
Created October 15, 2013 19:13
Show Gist options
  • Save zokier/6997067 to your computer and use it in GitHub Desktop.
Save zokier/6997067 to your computer and use it in GitHub Desktop.
test.rs:20:12: 20:18 error: type `&~A:Send` does not implement any method in scope named `a`
test.rs:20 a.a();
^~~~~~
error: aborting due to previous error
task '<unnamed>' failed at 'explicit failure', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:98
task '<unnamed>' failed at 'explicit failure', /build/rust-git/src/rust/src/librustc/rustc.rs:391
trait A {
fn a();
}
struct B;
impl A for B {
fn a() {
println!("a()");
}
}
struct C {
av: ~[~A]
}
impl C {
fn process(&self) {
for a in self.av.iter() {
a.a();
}
}
}
fn main() {
let c = C { av: ~[~B as ~A] };
c.process();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment