2011-03-25 12:19:20 -07:00
|
|
|
// xfail-stage0
|
2011-05-03 18:13:51 -07:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2011-07-12 15:27:17 -07:00
|
|
|
|
|
|
|
use std;
|
|
|
|
import std::task;
|
|
|
|
|
2011-04-19 13:35:49 -07:00
|
|
|
fn start(chan[chan[str]] c) {
|
2010-08-11 15:05:33 -07:00
|
|
|
let port[str] p = port();
|
|
|
|
c <| chan(p);
|
2011-05-27 11:59:19 -07:00
|
|
|
auto a; p |> a;
|
|
|
|
// auto b; p |> b; // Never read the second string.
|
2010-08-11 15:05:33 -07:00
|
|
|
}
|
|
|
|
|
2011-04-19 13:35:49 -07:00
|
|
|
fn main() {
|
2010-08-11 15:05:33 -07:00
|
|
|
let port[chan[str]] p = port();
|
2011-07-12 15:27:17 -07:00
|
|
|
auto child = spawn start(chan(p));
|
2011-05-27 11:59:19 -07:00
|
|
|
auto c; p |> c;
|
2010-08-11 15:05:33 -07:00
|
|
|
c <| "A";
|
|
|
|
c <| "B";
|
2011-07-12 15:27:17 -07:00
|
|
|
task::yield();
|
2011-05-26 18:17:13 -07:00
|
|
|
}
|