@@ -1274,7 +1274,7 @@ impl Expr {
12741274 ExprKind :: Let ( ..) => ExprPrecedence :: Let ,
12751275 ExprKind :: If ( ..) => ExprPrecedence :: If ,
12761276 ExprKind :: While ( ..) => ExprPrecedence :: While ,
1277- ExprKind :: ForLoop ( .. ) => ExprPrecedence :: ForLoop ,
1277+ ExprKind :: ForLoop { .. } => ExprPrecedence :: ForLoop ,
12781278 ExprKind :: Loop ( ..) => ExprPrecedence :: Loop ,
12791279 ExprKind :: Match ( ..) => ExprPrecedence :: Match ,
12801280 ExprKind :: Closure ( ..) => ExprPrecedence :: Closure ,
@@ -1436,10 +1436,10 @@ pub enum ExprKind {
14361436 While ( P < Expr > , P < Block > , Option < Label > ) ,
14371437 /// A `for` loop, with an optional label.
14381438 ///
1439- /// `'label: for pat in expr { block }`
1439+ /// `'label: for await? pat in iter { block }`
14401440 ///
14411441 /// 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 } ,
14431443 /// Conditionless loop (can be exited with `break`, `continue`, or `return`).
14441444 ///
14451445 /// `'label: loop { block }`
@@ -1542,6 +1542,13 @@ pub enum ExprKind {
15421542 Err ,
15431543}
15441544
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+
15451552/// Used to differentiate between `async {}` blocks and `gen {}` blocks.
15461553#[ derive( Clone , Encodable , Decodable , Debug , PartialEq , Eq ) ]
15471554pub enum GenBlockKind {
0 commit comments