diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-11 13:15:34 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-24 08:05:29 +0000 |
| commit | 20e40d5efedebd13edcbf059441a1684029fc5e1 (patch) | |
| tree | 6b804d6e04b904e64e6a737bf6eecf2990b8b96a | |
| parent | 9c0e5f2c34e35eb77c120a01ced1d7cb657f259b (diff) | |
| download | rust-20e40d5efedebd13edcbf059441a1684029fc5e1.tar.gz rust-20e40d5efedebd13edcbf059441a1684029fc5e1.zip | |
Error on using `yield` without also using `#[coroutine]` on the closure
And suggest adding the `#[coroutine]` to the closure
| -rw-r--r-- | tests/source/immovable_coroutines.rs | 3 | ||||
| -rw-r--r-- | tests/target/immovable_coroutines.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/source/immovable_coroutines.rs b/tests/source/immovable_coroutines.rs index 3b94af0c96c..539049577a0 100644 --- a/tests/source/immovable_coroutines.rs +++ b/tests/source/immovable_coroutines.rs @@ -1,7 +1,8 @@ #![feature(coroutines)] unsafe fn foo() { - let mut ga = static || { + let mut ga = #[coroutine] + static || { yield 1; }; } diff --git a/tests/target/immovable_coroutines.rs b/tests/target/immovable_coroutines.rs index f52cfa00f97..539049577a0 100644 --- a/tests/target/immovable_coroutines.rs +++ b/tests/target/immovable_coroutines.rs @@ -1,7 +1,8 @@ #![feature(coroutines)] unsafe fn foo() { - let mut ga = static || { + let mut ga = #[coroutine] + static || { yield 1; }; } |
