summaryrefslogtreecommitdiffstats
path: root/src/test/ui/functions-closures/closure-expected-type/supply-nothing.rs
blob: 8665cfc21a765d1f64aaa3b02986bfdeb87326c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
// run-pass
fn with_closure<F>(f: F) -> u32
    where F: FnOnce(&u32, &u32) -> u32
{
    f(&22, &44)
}

fn main() {
    let z = with_closure(|x, y| x + y).wrapping_add(1);
    assert_eq!(z, 22 + 44 + 1);
}