about summary refs log tree commit diff
path: root/src/test/run-pass/fn-bare-spawn.rs
blob: 59a57b8597ce1e488d516706df2163be543376fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// This is what the signature to spawn should look like with bare functions

fn spawn<send 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;
    });
}