Skip to content

Commit

Permalink
improve comments on GeneratorKind and AsyncGeneratorKind
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Oct 2, 2019
1 parent 3ae4abb commit a999132
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/librustc/hir/mod.rs
Expand Up @@ -1362,7 +1362,6 @@ impl Body {
}

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

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

0 comments on commit a999132

Please sign in to comment.