about summary refs log tree commit diff
path: root/tests/ui/impl-trait/universal_hrtb_anon.rs
blob: 2ac5dd7cfb2dc78d20dffe42c0c5a2708bf791f0 (plain)
1
2
3
4
5
6
7
8
9
10
//@ run-pass

fn hrtb(f: impl Fn(&u32) -> u32) -> u32 {
    f(&22) + f(&44)
}

fn main() {
    let sum = hrtb(|x| x * 2);
    assert_eq!(sum, 22*2 + 44*2);
}