summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/old-closure-fn-coerce.rs
blob: d993ad9945974bc7091b8798c9ccc4e44af36965 (plain)
1
2
3
4
5
6
7
8
9
10
11
// run-pass
#![allow(unused_braces)]

fn force<F>(f: F) -> isize where F: FnOnce() -> isize { return f(); }

pub fn main() {
    fn f() -> isize { return 7; }
    assert_eq!(force(f), 7);
    let g = {||force(f)};
    assert_eq!(g(), 7);
}