rust/tests/ui/coroutine/issue-52304.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
170 B
Rust

//@ check-pass
#![feature(coroutines, coroutine_trait)]
use std::ops::Coroutine;
pub fn example() -> impl Coroutine {
#[coroutine]
|| yield &1
}
fn main() {}