@@ -1511,7 +1511,7 @@ impl<'hir> Body<'hir> {
1511
1511
#[ derive( HashStable_Generic , Encodable , Decodable ) ]
1512
1512
pub enum CoroutineKind {
1513
1513
/// An explicit `async` block or the body of an async function.
1514
- Async ( AsyncCoroutineKind ) ,
1514
+ Async ( CoroutineSource ) ,
1515
1515
1516
1516
/// A coroutine literal created via a `yield` inside a closure.
1517
1517
Coroutine ,
@@ -1535,40 +1535,40 @@ impl CoroutineKind {
1535
1535
}
1536
1536
}
1537
1537
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?
1540
1540
///
1541
1541
/// This helps error messages but is also used to drive coercions in
1542
1542
/// type-checking (see #60424).
1543
1543
#[ derive( Clone , PartialEq , Eq , Hash , Debug , Copy ) ]
1544
1544
#[ 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.
1547
1547
Block ,
1548
1548
1549
- /// An explicit `async` closure written by the user.
1549
+ /// An explicit `async`/`gen` closure written by the user.
1550
1550
Closure ,
1551
1551
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.
1553
1553
Fn ,
1554
1554
}
1555
1555
1556
- impl fmt:: Display for AsyncCoroutineKind {
1556
+ impl fmt:: Display for CoroutineSource {
1557
1557
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1558
1558
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" ,
1562
1562
} )
1563
1563
}
1564
1564
}
1565
1565
1566
- impl AsyncCoroutineKind {
1566
+ impl CoroutineSource {
1567
1567
pub fn descr ( & self ) -> & ' static str {
1568
1568
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" ,
1572
1572
}
1573
1573
}
1574
1574
}
0 commit comments