diff options
Diffstat (limited to 'tests/ui/functions-closures/fn-bare-spawn.rs')
-rw-r--r-- | tests/ui/functions-closures/fn-bare-spawn.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/functions-closures/fn-bare-spawn.rs b/tests/ui/functions-closures/fn-bare-spawn.rs new file mode 100644 index 000000000..0d46fe220 --- /dev/null +++ b/tests/ui/functions-closures/fn-bare-spawn.rs @@ -0,0 +1,15 @@ +// run-pass +// This is what the signature to spawn should look like with bare functions + + +fn spawn<T:Send>(val: T, f: fn(T)) { + f(val); +} + +fn f(i: isize) { + assert_eq!(i, 100); +} + +pub fn main() { + spawn(100, f); +} |