rust/src/test/run-pass/task-comm-10.rs

17 lines
347 B
Rust
Raw Normal View History

// xfail-boot
// xfail-stage0
impure fn start(chan[chan[str]] c) {
2010-08-11 17:05:33 -05:00
let port[str] p = port();
c <| chan(p);
auto a <- p;
// auto b <- p; // Never read the second string.
2010-08-11 17:05:33 -05:00
}
impure fn main() {
2010-08-11 17:05:33 -05:00
let port[chan[str]] p = port();
auto child = spawn "start" start(chan(p));
auto c <- p;
c <| "A";
c <| "B";
yield;
}