summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/universal_hrtb_anon.rs
blob: 30c8d291f6ad9e73ba9a05ddde2a85874544b91e (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);
}