2022-10-01 05:19:31 -05:00
|
|
|
error[E0597]: `a` does not live long enough
|
2024-04-11 08:15:34 -05:00
|
|
|
--> $DIR/borrowing.rs:9:46
|
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;
|
2024-04-18 15:41:43 -05:00
|
|
|
| - binding `a` declared here
|
2024-04-11 08:15:34 -05:00
|
|
|
LL | Pin::new(&mut #[coroutine] || yield &a).resume(())
|
|
|
|
| -- ^ borrowed value does not live long enough
|
|
|
|
| |
|
|
|
|
| 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;
|
2024-04-18 15:41:43 -05:00
|
|
|
| - binding `a` declared here
|
2024-04-11 08:15:34 -05:00
|
|
|
LL | #[coroutine] || {
|
|
|
|
| -- 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`.
|