rust/tests/ui/feature-gates/feature-gate-yield-expr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
312 B
Rust
Raw Normal View History

2025-03-06 01:09:08 +00:00
//@ 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
}