rust/tests/ui/coroutine/auxiliary/xcrate-reachable.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

16 lines
229 B
Rust

#![feature(coroutines, coroutine_trait)]
use std::ops::Coroutine;
fn msg() -> u32 {
0
}
pub fn foo() -> impl Coroutine<(), Yield = (), Return = u32> {
#[coroutine]
|| {
yield;
return msg();
}
}