forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#68582 - LeSeulArtichaut:code-explanations, …
…r=Dylan-DPC Add E0727 long explanation Add long explanation for the `E0727` error code (async generators not yet supported). Part of rust-lang#61137 r? @GuillaumeGomez
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
A `yield` clause was used in an `async` context. | ||
|
||
Example of erroneous code: | ||
|
||
```compile_fail | ||
#![feature(generators)] | ||
let generator = || { | ||
async { | ||
yield; | ||
} | ||
}; | ||
``` | ||
|
||
Here, the `yield` keyword is used in an `async` block, | ||
which is not yet supported. | ||
|
||
To fix this error, you have to move `yield` out of the `async` block: | ||
|
||
``` | ||
#![feature(generators)] | ||
let generator = || { | ||
yield; | ||
}; | ||
``` |