rust/tests/ui/coroutine/auxiliary/unwind-aux.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

13 lines
240 B
Rust

//@ compile-flags: -Cpanic=unwind --crate-type=lib
//@ no-prefer-dynamic
//@ edition:2021
#![feature(coroutines, stmt_expr_attributes)]
pub fn run<T>(a: T) {
let _ = #[coroutine]
move || {
drop(a);
yield;
};
}