]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/ref-escapes-but-not-over-yield.nll.stderr
Auto merge of #50409 - KiChjang:issue-50343, r=nikomatsakis
[rust.git] / src / test / ui / generator / ref-escapes-but-not-over-yield.nll.stderr
1 error[E0597]: `b` does not live long enough
2   --> $DIR/ref-escapes-but-not-over-yield.rs:24:13
3    |
4 LL |       let mut b = move || {
5    |  _________________-
6 LL | |         yield();
7 LL | |         let b = 5;
8 LL | |         a = &b;
9    | |             ^^ borrowed value does not live long enough
10 LL | |         //~^ ERROR `b` does not live long enough
11 LL | |     };
12    | |     -
13    | |     |
14    | |     borrowed value only lives until here
15    | |_____temporary later dropped here, potentially using the reference
16    |       borrow may end up in a temporary, created here
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0597`.