rust/tests/mir-opt/coroutine_drop_cleanup.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

17 lines
404 B
Rust

// skip-filecheck
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Regression test for #58892, coroutine drop shims should not have blocks
// spuriously marked as cleanup
// EMIT_MIR coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.mir
fn main() {
let gen = #[coroutine]
|| {
let _s = String::new();
yield;
};
}