2019-04-22 08:40:08 +01:00
|
|
|
error[E0597]: `y` does not live long enough
|
|
|
|
--> $DIR/regions-nested-fns-2.rs:7:25
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2024-04-18 20:41:43 +00:00
|
|
|
LL | let y = 3;
|
|
|
|
| - binding `y` declared here
|
|
|
|
LL | ignore(
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | |z| {
|
2019-04-22 08:40:08 +01:00
|
|
|
| --- value captured here
|
2018-02-23 03:42:32 +03:00
|
|
|
LL | if false { &y } else { z }
|
2019-04-22 08:40:08 +01: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 22:47:55 +03:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2017-12-10 22:47:55 +03:00
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
For more information about this error, try `rustc --explain E0597`.
|