rust/tests/ui/coroutine/print/coroutine-print-verbose-3.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

14 lines
279 B
Rust

//@ compile-flags: -Zverbose-internals
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
fn main() {
let x = "Type mismatch test";
let coroutine: () = #[coroutine]
|| {
//~^ ERROR mismatched types
yield 1i32;
return x;
};
}