mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Update and un-XFAIL run-pass/many.rs
This commit is contained in:
@@ -1,24 +1,21 @@
|
||||
// xfail-stage1
|
||||
// xfail-stage2
|
||||
// xfail-stage3
|
||||
// -*- rust -*-
|
||||
|
||||
fn sub(chan[int] parent, int id) {
|
||||
fn sub(parent: chan[int], id: int) {
|
||||
if (id == 0) {
|
||||
parent <| 0;
|
||||
} else {
|
||||
let port[int] p = port();
|
||||
auto child = spawn sub(chan(p), id-1);
|
||||
let int y; p |> y;
|
||||
let p: port[int] = port();
|
||||
let child = spawn sub(chan(p), id-1);
|
||||
let y: int; p |> y;
|
||||
parent <| y + 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let port[int] p = port();
|
||||
auto child = spawn sub(chan(p), 500);
|
||||
let int p |> y;
|
||||
let p: port[int] = port();
|
||||
let child = spawn sub(chan(p), 200);
|
||||
let y: int; p |> y;
|
||||
log "transmission complete";
|
||||
log y;
|
||||
assert (y == 500);
|
||||
assert (y == 200);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user