rust/tests/ui/coroutine/auxiliary/metadata-sufficient-for-layout.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
236 B
Rust

//@ compile-flags: --emit metadata
#![feature(coroutines, coroutine_trait)]
use std::marker::Unpin;
use std::ops::Coroutine;
pub fn g() -> impl Coroutine<(), Yield = (), Return = ()> {
#[coroutine]
|| {
yield;
}
}