Skip to content

Commit 2e5b367

Browse files
committed
Demonstrate issue with yield checks
1 parent 638d2d6 commit 2e5b367

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

tests/ui/coroutine/gen_block.none.stderr

+12-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ error[E0422]: cannot find struct, variant or union type `gen` in this scope
2424
LL | gen {};
2525
| ^^^ not found in this scope
2626

27-
error: aborting due to 4 previous errors
27+
error[E0658]: yield syntax is experimental
28+
--> $DIR/gen_block.rs:14:16
29+
|
30+
LL | let _ = || yield true;
31+
| ^^^^^^^^^^
32+
|
33+
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
34+
= help: add `#![feature(coroutines)]` to the crate attributes to enable
35+
36+
error: aborting due to 5 previous errors
2837

29-
For more information about this error, try `rustc --explain E0422`.
38+
Some errors have detailed explanations: E0422, E0658.
39+
For more information about an error, try `rustc --explain E0422`.

tests/ui/coroutine/gen_block.rs

+3
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ fn main() {
1111
//[none]~| ERROR: cannot find
1212
gen {};
1313
//[none]~^ ERROR: cannot find
14+
15+
// FIXME(gen_blocks): should also error in 2024 edition
16+
let _ = || yield true; //[none]~ ERROR yield syntax is experimental
1417
}

0 commit comments

Comments
 (0)