2015-01-08 04:54:35 -06:00
|
|
|
fn select<'r>(x: &'r isize, y: &'r isize) -> &'r isize { x }
|
2012-07-19 12:10:22 -05:00
|
|
|
|
2015-01-08 04:54:35 -06:00
|
|
|
fn with<T, F>(f: F) -> T where F: FnOnce(&isize) -> T {
|
2012-07-19 12:10:22 -05:00
|
|
|
f(&20)
|
|
|
|
}
|
|
|
|
|
2015-01-08 04:54:35 -06:00
|
|
|
fn manip<'a>(x: &'a isize) -> isize {
|
2013-11-21 19:23:21 -06:00
|
|
|
let z = with(|y| { select(x, y) });
|
2020-05-20 12:58:41 -05:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2012-07-19 12:10:22 -05:00
|
|
|
*z
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2013-02-14 13:47:00 -06:00
|
|
|
}
|