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 | dda4709b1cba078ab05a32aa9c9359537e0ae0ad (patch) | |
| tree | f4fac428583c9bf94480ded07ee7734df21a3c72 /example/polymorphize_coroutine.rs | |
| parent | 36449f8cd6a2166dec0799499218f89e2b25402c (diff) | |
Error on using `yield` without also using `#[coroutine]` on the closure
And suggest adding the `#[coroutine]` to the closure
Diffstat (limited to 'example/polymorphize_coroutine.rs')
| -rw-r--r-- | example/polymorphize_coroutine.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/example/polymorphize_coroutine.rs b/example/polymorphize_coroutine.rs index c965b34e13b..407da94c0f0 100644 --- a/example/polymorphize_coroutine.rs +++ b/example/polymorphize_coroutine.rs @@ -1,4 +1,4 @@ -#![feature(coroutines, coroutine_trait)] +#![feature(coroutines, coroutine_trait, stmt_expr_attributes)] use std::ops::Coroutine; use std::pin::Pin; @@ -8,7 +8,8 @@ fn main() { } fn run_coroutine<T>() { - let mut coroutine = || { + let mut coroutine = #[coroutine] + || { yield; return; }; |
