This code gives "error: type `&~A:Send` does not implement any method
in scope named `a`" when compiled with rustc 0.9-pre (c8e77d5
2013-10-14 07:26:47 -0700).
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(); // <-- error here
}
}
}
fn main() {
let c = C { av: ~[~B as ~A] };
c.process();
}
Could someone explain why and how to work around the issue?
/Torste Aikio
ps. I hope this is right place to ask
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev