summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-gen_blocks.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-gen_blocks.rs')
-rw-r--r--tests/ui/feature-gates/feature-gate-gen_blocks.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.rs b/tests/ui/feature-gates/feature-gate-gen_blocks.rs
index e2e1574a3..ff9a0b139 100644
--- a/tests/ui/feature-gates/feature-gate-gen_blocks.rs
+++ b/tests/ui/feature-gates/feature-gate-gen_blocks.rs
@@ -1,15 +1,28 @@
// revisions: e2024 none
//[e2024] compile-flags: --edition 2024 -Zunstable-options
-fn main() {
+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`
}