2023-10-20 05:46:28 +08:00
|
|
|
error[E0626]: borrow may still be in use when coroutine yields
|
2019-05-03 06:34:15 +08:00
|
|
|
--> $DIR/yield-while-local-borrowed.rs:13:17
|
2018-01-29 15:29:58 +08:00
|
|
|
|
|
2024-07-22 09:37:22 +08:00
|
|
|
LL | let mut b = #[coroutine] move || {
|
|
|
|
| ------- within this coroutine
|
2018-02-23 08:42:32 +08:00
|
|
|
LL | let a = &mut 3;
|
2018-01-29 15:29:58 +08:00
|
|
|
| ^^^^^^
|
2019-05-03 06:34:15 +08:00
|
|
|
LL |
|
2023-10-20 00:06:43 +08:00
|
|
|
LL | yield ();
|
|
|
|
| -------- possible yield occurs here
|
2024-07-22 09:37:22 +08:00
|
|
|
|
|
|
|
|
help: add `static` to mark this coroutine as unmovable
|
|
|
|
|
|
|
|
|
LL | let mut b = #[coroutine] static move || {
|
|
|
|
| ++++++
|
2018-01-29 15:29:58 +08:00
|
|
|
|
2023-10-20 05:46:28 +08:00
|
|
|
error[E0626]: borrow may still be in use when coroutine yields
|
2019-05-03 06:34:15 +08:00
|
|
|
--> $DIR/yield-while-local-borrowed.rs:40:21
|
2018-01-12 02:49:26 +08:00
|
|
|
|
|
2024-07-22 09:37:22 +08:00
|
|
|
LL | let mut b = #[coroutine] move || {
|
|
|
|
| ------- within this coroutine
|
|
|
|
...
|
2018-02-23 08:42:32 +08:00
|
|
|
LL | let b = &a;
|
2018-01-12 02:49:26 +08:00
|
|
|
| ^^
|
2019-05-03 06:34:15 +08:00
|
|
|
LL |
|
2023-10-20 00:06:43 +08:00
|
|
|
LL | yield ();
|
|
|
|
| -------- possible yield occurs here
|
2024-07-22 09:37:22 +08:00
|
|
|
|
|
|
|
|
help: add `static` to mark this coroutine as unmovable
|
|
|
|
|
|
|
|
|
LL | let mut b = #[coroutine] static move || {
|
|
|
|
| ++++++
|
2017-07-15 18:52:49 +08:00
|
|
|
|
2019-05-03 06:34:15 +08:00
|
|
|
error: aborting due to 2 previous errors
|
2017-07-15 18:52:49 +08:00
|
|
|
|
2018-03-03 22:59:40 +08:00
|
|
|
For more information about this error, try `rustc --explain E0626`.
|