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

9 lines
153 B
Rust
Raw Normal View History

2011-10-20 22:34:04 -05:00
fn f(i: int) {
assert i == 10;
}
fn main() {
// Binding a bare function turns it into a shared closure
let g: fn@() = bind f(10);
g();
}