rust/tests/ui/feature-gates/feature-gate-yield-expr.rs
2025-03-06 11:33:24 -08:00

10 lines
312 B
Rust

//@ edition: 2024
#![feature(stmt_expr_attributes)]
fn main() {
yield (); //~ ERROR yield syntax is experimental
//~^ ERROR yield syntax is experimental
//~^^ ERROR `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
//~^^^ ERROR yield expression outside of coroutine literal
}