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

13 lines
210 B
Rust

// This is what the signature to spawn should look like with bare functions
fn spawn<T: send>(val: T, f: extern fn(T)) {
f(val);
}
fn f(&&i: int) {
assert i == 100;
}
fn main() {
spawn(100, f);
}