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 | df0639b6e12c98dc736acf81b9eccaf862ecc362 (patch) | |
| tree | 548111da87db25203b796d49e7883a0148587d0e | |
| parent | 752af44fc44c4910a19fc751d1f576abbdb2cb8a (diff) | |
| download | rust-df0639b6e12c98dc736acf81b9eccaf862ecc362.tar.gz rust-df0639b6e12c98dc736acf81b9eccaf862ecc362.zip | |
Error on using `yield` without also using `#[coroutine]` on the closure
And suggest adding the `#[coroutine]` to the closure
| -rw-r--r-- | example/std_example.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/example/std_example.rs b/example/std_example.rs index ad69409eb65..8ab8fcc525e 100644 --- a/example/std_example.rs +++ b/example/std_example.rs @@ -1,5 +1,5 @@ #![allow(internal_features)] -#![feature(core_intrinsics, coroutines, coroutine_trait, is_sorted)] +#![feature(core_intrinsics, coroutines, coroutine_trait, is_sorted, stmt_expr_attributes)] #[cfg(feature="master")] #[cfg(target_arch="x86_64")] @@ -103,7 +103,7 @@ fn main() { test_simd(); } - Box::pin(move |mut _task_context| { + Box::pin(#[coroutine] move |mut _task_context| { yield (); }).as_mut().resume(0); |
