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

16 lines
265 B
Rust
Raw Normal View History

// This is what the signature to spawn should look like with bare functions
fn spawn<uniq T>(val: T, f: fn(T)) {
f(val);
}
2011-10-20 22:34:04 -05:00
fn f(&&i: int) {
assert i == 100;
}
fn main() {
spawn(100, f);
2011-10-20 22:34:04 -05:00
spawn(100, fn(&&i: int) {
assert i == 100;
});
}