rust/tests/ui/coroutine/yield-while-local-borrowed....

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.1 KiB
Plaintext
Raw Normal View History

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
|
LL | let mut b = #[coroutine] move || {
| ------- within this coroutine
2018-02-23 08:42:32 +08:00
LL | let a = &mut 3;
| ^^^^^^
2019-05-03 06:34:15 +08:00
LL |
2023-10-20 00:06:43 +08:00
LL | yield ();
| -------- possible yield occurs here
|
help: add `static` to mark this coroutine as unmovable
|
LL | let mut b = #[coroutine] static move || {
| ++++++
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
|
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
|
help: add `static` to mark this coroutine as unmovable
|
LL | let mut b = #[coroutine] static move || {
| ++++++
2019-05-03 06:34:15 +08:00
error: aborting due to 2 previous errors
2018-03-03 22:59:40 +08:00
For more information about this error, try `rustc --explain E0626`.