Demonstrate issue with yield checks

This commit is contained in:
Oli Scherer 2023-10-23 14:00:34 +00:00
parent 638d2d6fc1
commit 2e5b36741b
2 changed files with 15 additions and 2 deletions

View File

@ -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
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`.

View File

@ -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
}