rust/src/test/run-pass/send-resource.rs

22 lines
289 B
Rust
Raw Normal View History

import task::*;
import comm::*;
2012-08-15 20:46:55 -05:00
struct test {
let f: int;
new(f: int) { self.f = f; }
drop {}
}
fn main() {
let p = port();
let c = chan(p);
do spawn() {
let p = port();
c.send(chan(p));
let _r = p.recv();
}
p.recv().send(test(42));
}