2019-04-22 02:40:08 -05:00
|
|
|
error[E0597]: `y` does not live long enough
|
|
|
|
--> $DIR/regions-nested-fns-2.rs:7:25
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | |z| {
|
2019-04-22 02:40:08 -05:00
|
|
|
| --- value captured here
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | if false { &y } else { z }
|
2019-04-22 02:40:08 -05:00
|
|
|
| -^
|
|
|
|
| ||
|
|
|
|
| |borrowed value does not live long enough
|
|
|
|
| returning this value requires that `y` is borrowed for `'static`
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - `y` dropped here while still borrowed
|
2017-12-10 13:47:55 -06:00
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2017-12-10 13:47:55 -06:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
For more information about this error, try `rustc --explain E0597`.
|