rust/src/test/compile-fail/no-send-res-ports.rs
2012-09-07 14:02:33 -07:00

21 lines
346 B
Rust

fn main() {
struct foo {
_x: comm::Port<()>,
drop {}
}
fn foo(x: comm::Port<()>) -> foo {
foo {
_x: x
}
}
let x = ~mut Some(foo(comm::Port()));
do task::spawn |move x| { //~ ERROR not a sendable value
let mut y = None;
*x <-> y;
log(error, y);
}
}