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

15 lines
239 B
Rust
Raw Normal View History

2011-10-20 22:34:04 -05:00
fn f(i: int, &called: bool) {
assert i == 10;
called = true;
}
fn g(f: native fn(int, &bool), &called: bool) {
f(10, called);
}
fn main() {
let called = false;
let h = f;
g(h, called);
assert called == true;
}