2022-10-01 05:19:31 -05:00
|
|
|
error[E0597]: `a` does not live long enough
|
2023-05-07 13:38:52 -05:00
|
|
|
--> $DIR/borrowing.rs:9:33
|
2022-10-01 05:19:31 -05:00
|
|
|
|
|
2023-10-24 12:16:15 -05:00
|
|
|
LL | let _b = {
|
|
|
|
| -- borrow later stored here
|
|
|
|
LL | let a = 3;
|
2022-10-01 05:19:31 -05:00
|
|
|
LL | Pin::new(&mut || yield &a).resume(())
|
2023-10-24 12:16:15 -05:00
|
|
|
| -- ^ borrowed value does not live long enough
|
|
|
|
| |
|
2023-10-19 16:46:28 -05:00
|
|
|
| value captured here by coroutine
|
2022-10-01 05:19:31 -05:00
|
|
|
LL |
|
|
|
|
LL | };
|
2023-10-24 12:16:15 -05:00
|
|
|
| - `a` dropped here while still borrowed
|
2022-10-01 05:19:31 -05:00
|
|
|
|
|
|
|
error[E0597]: `a` does not live long enough
|
2023-05-07 13:38:52 -05:00
|
|
|
--> $DIR/borrowing.rs:16:20
|
2022-10-01 05:19:31 -05:00
|
|
|
|
|
|
|
|
LL | let _b = {
|
|
|
|
| -- borrow later stored here
|
|
|
|
LL | let a = 3;
|
|
|
|
LL | || {
|
2023-10-19 16:46:28 -05:00
|
|
|
| -- value captured here by coroutine
|
2022-10-01 05:19:31 -05:00
|
|
|
LL | yield &a
|
|
|
|
| ^ borrowed value does not live long enough
|
|
|
|
...
|
|
|
|
LL | };
|
|
|
|
| - `a` dropped here while still borrowed
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|