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

14 lines
215 B
Rust
Raw Normal View History

// This is what the signature to spawn should look like with bare functions
fn spawn<T: Send>(val: T, f: extern fn(T)) {
2012-09-19 00:45:24 -05:00
f(move val);
}
fn f(+i: int) {
assert i == 100;
}
fn main() {
spawn(100, f);
}