summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/universal_hrtb_named.rs
blob: 07ff5d23e0ca682670451437b434170d7d436d63 (plain)
1
2
3
4
5
6
7
8
9
10
// run-pass

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

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