blob: 063ec84288d1f79a57dde81a7362d86392b6fb3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
fn select<'r>(x: &'r isize, y: &'r isize) -> &'r isize { x }
fn with<T, F>(f: F) -> T where F: FnOnce(&isize) -> T {
f(&20)
}
fn manip<'a>(x: &'a isize) -> isize {
let z = with(|y| { select(x, y) });
//~^ ERROR lifetime may not live long enough
*z
}
fn main() {
}
|