@@ -1511,7 +1511,7 @@ impl<'hir> Body<'hir> {
15111511#[ derive( HashStable_Generic , Encodable , Decodable ) ]
15121512pub enum CoroutineKind {
15131513 /// An explicit `async` block or the body of an async function.
1514- Async ( AsyncCoroutineKind ) ,
1514+ Async ( CoroutineSource ) ,
15151515
15161516 /// A coroutine literal created via a `yield` inside a closure.
15171517 Coroutine ,
@@ -1535,40 +1535,40 @@ impl CoroutineKind {
15351535 }
15361536}
15371537
1538- /// In the case of a coroutine created as part of an async construct,
1539- /// which kind of async construct caused it to be created?
1538+ /// In the case of a coroutine created as part of an async/gen construct,
1539+ /// which kind of async/gen construct caused it to be created?
15401540///
15411541/// This helps error messages but is also used to drive coercions in
15421542/// type-checking (see #60424).
15431543#[ derive( Clone , PartialEq , Eq , Hash , Debug , Copy ) ]
15441544#[ derive( HashStable_Generic , Encodable , Decodable ) ]
1545- pub enum AsyncCoroutineKind {
1546- /// An explicit `async` block written by the user.
1545+ pub enum CoroutineSource {
1546+ /// An explicit `async`/`gen` block written by the user.
15471547 Block ,
15481548
1549- /// An explicit `async` closure written by the user.
1549+ /// An explicit `async`/`gen` closure written by the user.
15501550 Closure ,
15511551
1552- /// The `async` block generated as the body of an async function.
1552+ /// The `async`/`gen` block generated as the body of an async/gen function.
15531553 Fn ,
15541554}
15551555
1556- impl fmt:: Display for AsyncCoroutineKind {
1556+ impl fmt:: Display for CoroutineSource {
15571557 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
15581558 f. write_str ( match self {
1559- AsyncCoroutineKind :: Block => "async block" ,
1560- AsyncCoroutineKind :: Closure => "async closure body" ,
1561- AsyncCoroutineKind :: Fn => "async fn body" ,
1559+ CoroutineSource :: Block => "async block" ,
1560+ CoroutineSource :: Closure => "async closure body" ,
1561+ CoroutineSource :: Fn => "async fn body" ,
15621562 } )
15631563 }
15641564}
15651565
1566- impl AsyncCoroutineKind {
1566+ impl CoroutineSource {
15671567 pub fn descr ( & self ) -> & ' static str {
15681568 match self {
1569- AsyncCoroutineKind :: Block => "`async` block" ,
1570- AsyncCoroutineKind :: Closure => "`async` closure body" ,
1571- AsyncCoroutineKind :: Fn => "`async fn` body" ,
1569+ CoroutineSource :: Block => "`async` block" ,
1570+ CoroutineSource :: Closure => "`async` closure body" ,
1571+ CoroutineSource :: Fn => "`async fn` body" ,
15721572 }
15731573 }
15741574}
0 commit comments