1 error: borrowed data escapes outside of closure
2 --> $DIR/regions-nested-fns.rs:20:9
4 LL | let mut ay = &y; //~ ERROR E0495
5 | ------ `ay` is declared here, outside of the closure body
7 LL | ignore::<Box<for<'z> FnMut(&'z isize)>>(Box::new(|z| {
8 | - `z` is a reference that is only valid in the closure body
11 | ^^^^^^ `z` escapes the closure body here
13 error[E0597]: `y` does not live long enough
14 --> $DIR/regions-nested-fns.rs:15:18
16 LL | let mut ay = &y; //~ ERROR E0495
17 | ^^ borrowed value does not live long enough
20 | - `y` dropped here while still borrowed
22 = note: borrowed value must be valid for the static lifetime...
24 error[E0597]: `y` does not live long enough
25 --> $DIR/regions-nested-fns.rs:19:15
27 LL | ignore::<Box<for<'z> FnMut(&'z isize)>>(Box::new(|z| {
28 | - has type `&'0 isize`
31 | ^ `y` would have to be valid for `'0`
34 | - ...but `y` is only valid for the duration of the `nested` function, so it is dropped here while still borrowed
36 error: unsatisfied lifetime constraints
37 --> $DIR/regions-nested-fns.rs:23:68
39 LL | fn nested<'x>(x: &'x isize) {
40 | -- lifetime `'x` defined here
42 LL | ignore::< Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
43 | ____________________________________________________________________^
44 LL | | if false { return x; } //~ ERROR E0312
45 LL | | if false { return ay; }
48 | |_____^ closure body requires that `'x` must outlive `'static`
50 error: aborting due to 4 previous errors
52 For more information about this error, try `rustc --explain E0597`.