Skip to content

Commit 76ec35a

Browse files
committed
auto merge of #6099 : danluu/rust/xfail_clone, r=catamorphism
One of the tests seems to have no current equivalent that's similar. Please let me know if that's incorrect, and I'll try fixing it instead of deleting it. I suppose a struct could be used instead of `any` and `match type`, but it seems like the original intent of the test was to exercise `match type`
2 parents 3290110 + e9814da commit 76ec35a

File tree

3 files changed

+20
-31
lines changed

3 files changed

+20
-31
lines changed

src/test/run-pass/alt-type-simple.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.

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
}

src/test/run-pass/infinite-loops.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515
// xfail-test
1616

1717
extern mod std;
18-
use task::join;
19-
20-
fn loop(n: int) {
21-
let t1: task;
22-
let t2: task;
23-
24-
if n > 0 { t1 = spawn loop(n - 1); t2 = spawn loop(n - 1); }
25-
2618

19+
fn loopy(n: int) {
20+
if n > 0 { do spawn { loopy(n - 1) }; do spawn { loopy(n - 1) }; }
2721
loop { }
2822
}
2923

30-
pub fn main() { let t: task = spawn loop(5); join(t); }
24+
pub fn main() {
25+
// Commenting this out, as this will hang forever otherwise.
26+
// Even after seeing the comment above, I'm not sure what the
27+
// intention of this test is.
28+
// do spawn { loopy(5) };
29+
}

0 commit comments

Comments
 (0)