Skip to content

Commit 976a146

Browse files
Add E0727 long explanation
1 parent 8a79d08 commit 976a146

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/librustc_error_codes/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ E0718: include_str!("./error_codes/E0718.md"),
397397
E0720: include_str!("./error_codes/E0720.md"),
398398
E0723: include_str!("./error_codes/E0723.md"),
399399
E0725: include_str!("./error_codes/E0725.md"),
400+
E0727: include_str!("./error_codes/E0727.md"),
400401
E0728: include_str!("./error_codes/E0728.md"),
401402
E0729: include_str!("./error_codes/E0729.md"),
402403
E0730: include_str!("./error_codes/E0730.md"),
@@ -607,6 +608,5 @@ E0746: include_str!("./error_codes/E0746.md"),
607608
E0722, // Malformed `#[optimize]` attribute
608609
E0724, // `#[ffi_returns_twice]` is only allowed in foreign functions
609610
E0726, // non-explicit (not `'_`) elided lifetime in unsupported position
610-
E0727, // `async` generators are not yet supported
611611
E0739, // invalid track_caller application/syntax
612612
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
A `yield` clause was used in an `async` context.
2+
3+
Example of erroneous code:
4+
5+
```compile_fail
6+
#![feature(generators)]
7+
8+
let generator = || {
9+
async {
10+
yield;
11+
}
12+
};
13+
```
14+
15+
Here, the `yield` keyword is used in an `async` block,
16+
which is not yet supported.
17+
18+
To fix this error, you have to move `yield` out of the `async` block:
19+
20+
```
21+
#![feature(generators)]
22+
23+
let generator = || {
24+
yield;
25+
};
26+
```

0 commit comments

Comments
 (0)