]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/universal_hrtb_named.rs
Merge commit '40b00f4200fbdeefd11815398cb46394b8cb0a5e' into sync_cg_clif-2021-12-30
[rust.git] / src / test / ui / impl-trait / universal_hrtb_named.rs
1 // run-pass
2
3 fn hrtb(f: impl for<'a> Fn(&'a u32) -> &'a u32) -> u32 {
4     f(&22) + f(&44)
5 }
6
7 fn main() {
8     let sum = hrtb(|x| x);
9     assert_eq!(sum, 22 + 44);
10 }