about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-10-23 14:00:34 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-10-27 13:05:48 +0000
commit2e5b36741bdfd0ecccefac0c8b6d4fa2cb5b0770 (patch)
treeb0a62f0f919a649c272c08dcf8fc60df065c245f /tests
parent638d2d6fc109620a45d15b22e7cb21292de6e45b (diff)
downloadrust-2e5b36741bdfd0ecccefac0c8b6d4fa2cb5b0770.tar.gz
rust-2e5b36741bdfd0ecccefac0c8b6d4fa2cb5b0770.zip
Demonstrate issue with `yield` checks
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/coroutine/gen_block.none.stderr14
-rw-r--r--tests/ui/coroutine/gen_block.rs3
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 <https://github.com/rust-lang/rust/issues/43122> for more information
+   = help: add `#![feature(coroutines)]` to the crate attributes to enable
+
+error: aborting due to 5 previous errors
 
-For more information about this error, try `rustc --explain E0422`.
+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
 }