@@ -1261,7 +1261,7 @@ impl Expr {
1261
1261
ExprKind :: Let ( ..) => ExprPrecedence :: Let ,
1262
1262
ExprKind :: If ( ..) => ExprPrecedence :: If ,
1263
1263
ExprKind :: While ( ..) => ExprPrecedence :: While ,
1264
- ExprKind :: ForLoop ( .. ) => ExprPrecedence :: ForLoop ,
1264
+ ExprKind :: ForLoop { .. } => ExprPrecedence :: ForLoop ,
1265
1265
ExprKind :: Loop ( ..) => ExprPrecedence :: Loop ,
1266
1266
ExprKind :: Match ( ..) => ExprPrecedence :: Match ,
1267
1267
ExprKind :: Closure ( ..) => ExprPrecedence :: Closure ,
@@ -1423,10 +1423,10 @@ pub enum ExprKind {
1423
1423
While ( P < Expr > , P < Block > , Option < Label > ) ,
1424
1424
/// A `for` loop, with an optional label.
1425
1425
///
1426
- /// `'label: for pat in expr { block }`
1426
+ /// `'label: for await? pat in iter { block }`
1427
1427
///
1428
1428
/// This is desugared to a combination of `loop` and `match` expressions.
1429
- ForLoop ( P < Pat > , P < Expr > , P < Block > , Option < Label > ) ,
1429
+ ForLoop { pat : P < Pat > , iter : P < Expr > , body : P < Block > , label : Option < Label > , kind : ForLoopKind } ,
1430
1430
/// Conditionless loop (can be exited with `break`, `continue`, or `return`).
1431
1431
///
1432
1432
/// `'label: loop { block }`
@@ -1529,6 +1529,13 @@ pub enum ExprKind {
1529
1529
Err ,
1530
1530
}
1531
1531
1532
+ /// Used to differentiate between `for` loops and `for await` loops.
1533
+ #[ derive( Clone , Copy , Encodable , Decodable , Debug , PartialEq , Eq ) ]
1534
+ pub enum ForLoopKind {
1535
+ For ,
1536
+ ForAwait ,
1537
+ }
1538
+
1532
1539
/// Used to differentiate between `async {}` blocks and `gen {}` blocks.
1533
1540
#[ derive( Clone , Encodable , Decodable , Debug , PartialEq , Eq ) ]
1534
1541
pub enum GenBlockKind {
0 commit comments