]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-nested-fns-2.nll.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[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    |         --- value captured here
6 LL |             //~^ ERROR E0373
7 LL |             if false { &y } else { z }
8    |                         ^ borrowed value does not live long enough
9 LL |         });
10 LL | }
11    | - `y` dropped here while still borrowed
12    |
13    = note: borrowed value must be valid for the static lifetime...
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0597`.