@@ -1274,7 +1274,7 @@ impl Expr {
1274
1274
ExprKind :: Let ( ..) => ExprPrecedence :: Let ,
1275
1275
ExprKind :: If ( ..) => ExprPrecedence :: If ,
1276
1276
ExprKind :: While ( ..) => ExprPrecedence :: While ,
1277
- ExprKind :: ForLoop ( .. ) => ExprPrecedence :: ForLoop ,
1277
+ ExprKind :: ForLoop { .. } => ExprPrecedence :: ForLoop ,
1278
1278
ExprKind :: Loop ( ..) => ExprPrecedence :: Loop ,
1279
1279
ExprKind :: Match ( ..) => ExprPrecedence :: Match ,
1280
1280
ExprKind :: Closure ( ..) => ExprPrecedence :: Closure ,
@@ -1436,10 +1436,10 @@ pub enum ExprKind {
1436
1436
While ( P < Expr > , P < Block > , Option < Label > ) ,
1437
1437
/// A `for` loop, with an optional label.
1438
1438
///
1439
- /// `'label: for pat in expr { block }`
1439
+ /// `'label: for await? pat in iter { block }`
1440
1440
///
1441
1441
/// This is desugared to a combination of `loop` and `match` expressions.
1442
- ForLoop ( P < Pat > , P < Expr > , P < Block > , Option < Label > ) ,
1442
+ ForLoop { pat : P < Pat > , iter : P < Expr > , body : P < Block > , label : Option < Label > , kind : ForLoopKind } ,
1443
1443
/// Conditionless loop (can be exited with `break`, `continue`, or `return`).
1444
1444
///
1445
1445
/// `'label: loop { block }`
@@ -1542,6 +1542,13 @@ pub enum ExprKind {
1542
1542
Err ,
1543
1543
}
1544
1544
1545
+ /// Used to differentiate between `for` loops and `for await` loops.
1546
+ #[ derive( Clone , Copy , Encodable , Decodable , Debug , PartialEq , Eq ) ]
1547
+ pub enum ForLoopKind {
1548
+ For ,
1549
+ ForAwait ,
1550
+ }
1551
+
1545
1552
/// Used to differentiate between `async {}` blocks and `gen {}` blocks.
1546
1553
#[ derive( Clone , Encodable , Decodable , Debug , PartialEq , Eq ) ]
1547
1554
pub enum GenBlockKind {
0 commit comments