about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-coroutines.rs
blob: b37a61d9105f1470d2c5b5751907ea441c06e759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ revisions: e2024 none
//@[e2024] edition: 2024

fn main() {
    yield true; //~ ERROR yield syntax is experimental
                //~^ ERROR yield expression outside of coroutine literal
                //~^^ ERROR yield syntax is experimental
                //~^^^ ERROR `yield` can only be used

    let _ = || yield true; //~ ERROR yield syntax is experimental
    //~^ ERROR yield syntax is experimental
    //~^^ ERROR `yield` can only be used
}

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