rust/src/test/run-pass/bind-thunk.rs

12 lines
140 B
Rust
Raw Normal View History

2010-06-23 21:03:09 -07:00
// -*- rust -*-
fn f() -> int { ret 42; }
2010-06-23 21:03:09 -07:00
fn main() {
let g: fn@() -> int = bind f();
2011-07-27 14:19:39 +02:00
let i: int = g();
assert (i == 42);
}