]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-nested-fns-2.nll.stderr
Improve 'dropped here' note.
[rust.git] / src / test / ui / regions / regions-nested-fns-2.nll.stderr
1 error[E0597]: `y` does not live long enough
2   --> $DIR/regions-nested-fns-2.rs:18:25
3    |
4 LL |         |z| {
5    |           - has type `&'0 isize`
6 LL |             //~^ ERROR E0373
7 LL |             if false { &y } else { z }
8    |                         ^ `y` would have to be valid for `'0`
9 LL |         });
10 LL | }
11    | - ...but `y` is only valid for the duration of the `nested` function, so it is dropped here while still borrowed
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0597`.