2023-10-23 11:34:27 +00:00
|
|
|
//@ revisions: e2024 none
|
2024-11-22 07:20:22 -08:00
|
|
|
//@[e2024] edition: 2024
|
2023-10-23 11:34:27 +00:00
|
|
|
|
2016-12-26 14:34:03 +01: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
|
2024-11-05 17:02:13 -08:00
|
|
|
//~^^ ERROR yield syntax is experimental
|
2024-04-11 13:15:34 +00:00
|
|
|
//~^^^ ERROR `yield` can only be used
|
2023-10-23 11:34:27 +00:00
|
|
|
|
2023-10-23 14:29:00 +00:00
|
|
|
let _ = || yield true; //~ ERROR yield syntax is experimental
|
2024-11-05 17:02:13 -08:00
|
|
|
//~^ ERROR yield syntax is experimental
|
2024-04-11 13:15:34 +00:00
|
|
|
//~^^ ERROR `yield` can only be used
|
2016-12-26 14:34:03 +01:00
|
|
|
}
|
2019-08-14 05:44:32 +02:00
|
|
|
|
2025-03-29 17:24:03 +00:00
|
|
|
#[cfg(false)]
|
2019-08-14 05:44:32 +02:00
|
|
|
fn foo() {
|
2023-10-23 11:34:27 +00:00
|
|
|
// Ok in 2024 edition
|
2024-11-05 17:02:13 -08:00
|
|
|
yield; //~ ERROR yield syntax is experimental
|
|
|
|
|
yield 0; //~ ERROR yield syntax is experimental
|
2019-08-14 05:44:32 +02:00
|
|
|
}
|