]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-infer-call-2.rs
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / regions / regions-infer-call-2.rs
1 // run-pass
2
3 fn takes_two(x: &isize, y: &isize) -> isize { *x + *y }
4
5 fn with<T, F>(f: F) -> T where F: FnOnce(&isize) -> T {
6     f(&20)
7 }
8
9 fn has_one<'a>(x: &'a isize) -> isize {
10     with(|y| takes_two(x, y))
11 }
12
13 pub fn main() {
14     assert_eq!(has_one(&2), 22);
15 }