rust/tests/ui/coroutine/drop-tracking-yielding-in-match-guards.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

12 lines
207 B
Rust

//@ build-pass
//@ edition:2018
#![feature(coroutines, stmt_expr_attributes)]
fn main() {
let _ = #[coroutine] static |x: u8| match x {
y if { yield } == y + 1 => (),
_ => (),
};
}