Skip to content

Commit 224a3d0

Browse files
committed
Add a test that uses a hypothetical bare-fn spawn signature
Issue rust-lang#1022
1 parent 2b0bc6f commit 224a3d0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/run-pass/fn-bare-spawn.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is what the signature to spawn should look like with bare functions
2+
3+
fn spawn<~T>(val: T, f: fn#(T)) {
4+
f(val);
5+
}
6+
7+
fn# f(&&i: int) {
8+
assert i == 100;
9+
}
10+
11+
fn main() {
12+
spawn(100, f);
13+
spawn(100, fn#(&&i: int) {
14+
assert i == 100;
15+
});
16+
}

0 commit comments

Comments
 (0)