summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-coroutines.rs
blob: 53b58d486a804ce31fd2ae3e432df6ecd013d032 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// revisions: e2024 none
//[e2024] compile-flags: --edition 2024 -Zunstable-options

fn main() {
    yield true; //~ ERROR yield syntax is experimental
                //~^ ERROR yield expression outside of coroutine literal
                //[none]~^^ ERROR yield syntax is experimental

    let _ = || yield true; //~ ERROR yield syntax is experimental
    //[none]~^ ERROR yield syntax is experimental
}

#[cfg(FALSE)]
fn foo() {
    // Ok in 2024 edition
    yield; //[none]~ ERROR yield syntax is experimental
    yield 0; //[none]~ ERROR yield syntax is experimental
}