Skip to content

Commit a999132

Browse files
committed
improve comments on GeneratorKind and AsyncGeneratorKind
1 parent 3ae4abb commit a999132

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc/hir/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,6 @@ impl Body {
13621362
}
13631363

13641364
/// The type of source expression that caused this generator to be created.
1365-
// Not `IsAsync` because we want to eventually add support for `AsyncGen`
13661365
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
13671366
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
13681367
pub enum GeneratorKind {
@@ -1382,8 +1381,11 @@ impl fmt::Display for GeneratorKind {
13821381
}
13831382
}
13841383

1385-
/// The type of source expression that caused this generator to be created.
1386-
// Not `IsAsync` because we want to eventually add support for `AsyncGen`
1384+
/// In the case of a generator created as part of an async construct,
1385+
/// which kind of async construct caused it to be created?
1386+
///
1387+
/// This helps error messages but is also used to drive coercions in
1388+
/// type-checking (see #60424).
13871389
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
13881390
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
13891391
pub enum AsyncGeneratorKind {

0 commit comments

Comments
 (0)