From 2e5b36741bdfd0ecccefac0c8b6d4fa2cb5b0770 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 23 Oct 2023 14:00:34 +0000 Subject: [PATCH] Demonstrate issue with `yield` checks --- tests/ui/coroutine/gen_block.none.stderr | 14 ++++++++++++-- tests/ui/coroutine/gen_block.rs | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/ui/coroutine/gen_block.none.stderr b/tests/ui/coroutine/gen_block.none.stderr index d5ed28c5317..f1dd125efba 100644 --- a/tests/ui/coroutine/gen_block.none.stderr +++ b/tests/ui/coroutine/gen_block.none.stderr @@ -24,6 +24,16 @@ error[E0422]: cannot find struct, variant or union type `gen` in this scope LL | gen {}; | ^^^ not found in this scope -error: aborting due to 4 previous errors +error[E0658]: yield syntax is experimental + --> $DIR/gen_block.rs:14:16 + | +LL | let _ = || yield true; + | ^^^^^^^^^^ + | + = note: see issue #43122 for more information + = help: add `#![feature(coroutines)]` to the crate attributes to enable -For more information about this error, try `rustc --explain E0422`. +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0422, E0658. +For more information about an error, try `rustc --explain E0422`. diff --git a/tests/ui/coroutine/gen_block.rs b/tests/ui/coroutine/gen_block.rs index c09fa2ae9be..041dcf0c02a 100644 --- a/tests/ui/coroutine/gen_block.rs +++ b/tests/ui/coroutine/gen_block.rs @@ -11,4 +11,7 @@ fn main() { //[none]~| ERROR: cannot find gen {}; //[none]~^ ERROR: cannot find + + // FIXME(gen_blocks): should also error in 2024 edition + let _ = || yield true; //[none]~ ERROR yield syntax is experimental }