Skip to content

Commit 9968ccf

Browse files
committed
Update old xfailing spawn/bind/join test
1 parent cdd342b commit 9968ccf

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/test/run-pass/clone-with-exterior.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//xfail-test
12-
1311
extern mod std;
12+
use core::task::spawn;
1413

15-
fn f(x : @{a:int, b:int}) {
16-
assert!((x.a == 10));
17-
assert!((x.b == 12));
14+
struct Pair {
15+
a: int,
16+
b: int
1817
}
1918

2019
pub fn main() {
21-
let z : @{a:int, b:int} = @{ a : 10, b : 12};
22-
let p = task::_spawn(bind f(z));
23-
task::join_id(p);
20+
let z = ~Pair { a : 10, b : 12};
21+
22+
let f: ~fn() = || {
23+
assert!((z.a == 10));
24+
assert!((z.b == 12));
25+
};
26+
27+
spawn(f);
2428
}

0 commit comments

Comments
 (0)