Skip to content

Commit a0610c9

Browse files
committed
Add tests for #2190 (xfailed)
1 parent 59a034a commit a0610c9

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

src/test/run-pass/issue-2190-1.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// xfail-test
2+
const generations: uint = 1024+256+128+49;
3+
4+
fn child_no(x: uint) -> fn~() {
5+
|| {
6+
if x < generations {
7+
task::spawn(child_no(x+1));
8+
}
9+
}
10+
}
11+
12+
fn main() {
13+
task::spawn(child_no(0));
14+
}

src/test/run-pass/issue-2190-2.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// xfail-test
2+
mod a {
3+
fn foo(f: fn&()) { f() }
4+
fn bar() {}
5+
fn main() { foo(||bar()); }
6+
}
7+
8+
mod b {
9+
fn foo(f: Option<fn&()>) { f.iter(|x|x()) }
10+
fn bar() {}
11+
fn main() { foo(Some(bar)); }
12+
}
13+
14+
mod c {
15+
fn foo(f: Option<fn&()>) { f.iter(|x|x()) }
16+
fn bar() {}
17+
fn main() { foo(Some(||bar())); }
18+
}
19+
20+
fn main() {
21+
}

src/test/run-pass/issue-2190.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// xfail-test
2+
type t = {
3+
f: fn~()
4+
};
5+
6+
fn main() {
7+
let _t: t = { f: {||()} };
8+
}

0 commit comments

Comments
 (0)