1
Fork 0

Error on using yield without also using #[coroutine] on the closure

And suggest adding the `#[coroutine]` to the closure
This commit is contained in:
Oli Scherer 2024-04-11 13:15:34 +00:00
parent a589632dad
commit aef0f4024a
279 changed files with 1290 additions and 886 deletions

View file

@ -1,4 +1,4 @@
LL| |#![feature(coroutines, coroutine_trait)]
LL| |#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
LL| |
LL| |use std::ops::{Coroutine, CoroutineState};
LL| |use std::pin::Pin;
@ -18,7 +18,7 @@
LL| |
LL| 1|fn main() {
LL| 1| let is_true = std::env::args().len() == 1;
LL| 1| let mut coroutine = || {
LL| 1| let mut coroutine = #[coroutine] || {
LL| 1| yield get_u32(is_true);
LL| 1| return "foo";
LL| 1| };