mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
aef0f4024a
And suggest adding the `#[coroutine]` to the closure
21 lines
672 B
Rust
21 lines
672 B
Rust
//@ 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
|
|
//~^^^ ERROR `yield` can only be used
|
|
|
|
let _ = || yield true; //~ ERROR yield syntax is experimental
|
|
//[none]~^ ERROR yield syntax is experimental
|
|
//~^^ ERROR `yield` can only be used
|
|
}
|
|
|
|
#[cfg(FALSE)]
|
|
fn foo() {
|
|
// Ok in 2024 edition
|
|
yield; //[none]~ ERROR yield syntax is experimental
|
|
yield 0; //[none]~ ERROR yield syntax is experimental
|
|
}
|