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 9c0e5f2c34
commit 20e40d5efe
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,8 @@
#![feature(coroutines)]
unsafe fn foo() {
let mut ga = static || {
let mut ga = #[coroutine]
static || {
yield 1;
};
}

View File

@ -1,7 +1,8 @@
#![feature(coroutines)]
unsafe fn foo() {
let mut ga = static || {
let mut ga = #[coroutine]
static || {
yield 1;
};
}