rust/tests/ui/feature-gates/feature-gate-coroutines.rs

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

21 lines
648 B
Rust
Raw Normal View History

//@ revisions: e2024 none
//@[e2024] compile-flags: --edition 2024 -Zunstable-options
2016-12-26 13:34:03 +00:00
fn main() {
2023-10-23 14:29:00 +00:00
yield true; //~ ERROR yield syntax is experimental
2023-10-19 21:46:28 +00:00
//~^ ERROR yield expression outside of coroutine literal
//~^^ ERROR yield syntax is experimental
//~^^^ ERROR `yield` can only be used
2023-10-23 14:29:00 +00:00
let _ = || yield true; //~ ERROR yield syntax is experimental
//~^ ERROR yield syntax is experimental
//~^^ ERROR `yield` can only be used
2016-12-26 13:34:03 +00:00
}
2019-08-14 03:44:32 +00:00
#[cfg(FALSE)]
fn foo() {
// Ok in 2024 edition
yield; //~ ERROR yield syntax is experimental
yield 0; //~ ERROR yield syntax is experimental
2019-08-14 03:44:32 +00:00
}