mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
29 lines
806 B
Rust
29 lines
806 B
Rust
//@ revisions: e2024 none
|
|
//@[e2024] compile-flags: --edition 2024 -Zunstable-options
|
|
|
|
fn test_gen() {
|
|
gen {};
|
|
//[none]~^ ERROR: cannot find struct, variant or union type `gen`
|
|
//[e2024]~^^ ERROR: gen blocks are experimental
|
|
//[e2024]~| ERROR: type annotations needed
|
|
}
|
|
|
|
fn test_async_gen() {
|
|
async gen {};
|
|
//[none]~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen`
|
|
//[e2024]~^^ ERROR: gen blocks are experimental
|
|
//[e2024]~| ERROR: type annotations needed
|
|
}
|
|
|
|
fn main() {}
|
|
|
|
#[cfg(FALSE)]
|
|
fn foo() {
|
|
gen {};
|
|
//[e2024]~^ ERROR: gen blocks are experimental
|
|
|
|
async gen {};
|
|
//[e2024]~^ ERROR: gen blocks are experimental
|
|
//[none]~^^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen`
|
|
}
|