rust/tests/ui/coroutine/yield-outside-coroutine-issue-78653.rs
Oli Scherer aef0f4024a Error on using yield without also using #[coroutine] on the closure
And suggest adding the `#[coroutine]` to the closure
2024-04-24 08:05:29 +00:00

9 lines
217 B
Rust

#![feature(coroutines)]
fn main() {
yield || for i in 0 { }
//~^ ERROR yield expression outside of coroutine literal
//~| ERROR `{integer}` is not an iterator
//~| ERROR `yield` can only be used in
}