Add a test that uses a hypothetical bare-fn spawn signature
Issue #1022
This commit is contained in:
parent
1b0f1f0b79
commit
90c2402089
16
src/test/run-pass/fn-bare-spawn.rs
Normal file
16
src/test/run-pass/fn-bare-spawn.rs
Normal file
@ -0,0 +1,16 @@
|
||||
// This is what the signature to spawn should look like with bare functions
|
||||
|
||||
fn spawn<~T>(val: T, f: fn#(T)) {
|
||||
f(val);
|
||||
}
|
||||
|
||||
fn# f(&&i: int) {
|
||||
assert i == 100;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
spawn(100, f);
|
||||
spawn(100, fn#(&&i: int) {
|
||||
assert i == 100;
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user