rust/src/test/run-pass/fn-bare-assign.rs
Niko Matsakis ba3eebd41d Make it illegal to use modes in a fn signature with providing
an explicit variable name. (Step one to changing the defaults)

First step to #3535
2012-09-23 13:30:13 -05:00

15 lines
246 B
Rust

fn f(i: int, &called: bool) {
assert i == 10;
called = true;
}
fn g(f: extern fn(int, &v: bool), &called: bool) {
f(10, called);
}
fn main() {
let mut called = false;
let h = f;
g(h, called);
assert called == true;
}