summaryrefslogtreecommitdiffstats
path: root/tests/ui/functions-closures/fn-bare-assign.rs
blob: f5dab3c8402139196ffc2e10c76e1e5c39c7db9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass

fn f(i: isize, called: &mut bool) {
    assert_eq!(i, 10);
    *called = true;
}

fn g(f: fn(isize, v: &mut bool), called: &mut bool) {
    f(10, called);
}

pub fn main() {
    let mut called = false;
    let h = f;
    g(h, &mut called);
    assert_eq!(called, true);
}