@@ -1261,7 +1261,7 @@ impl Expr {
12611261 ExprKind :: Let ( ..) => ExprPrecedence :: Let ,
12621262 ExprKind :: If ( ..) => ExprPrecedence :: If ,
12631263 ExprKind :: While ( ..) => ExprPrecedence :: While ,
1264- ExprKind :: ForLoop ( .. ) => ExprPrecedence :: ForLoop ,
1264+ ExprKind :: ForLoop { .. } => ExprPrecedence :: ForLoop ,
12651265 ExprKind :: Loop ( ..) => ExprPrecedence :: Loop ,
12661266 ExprKind :: Match ( ..) => ExprPrecedence :: Match ,
12671267 ExprKind :: Closure ( ..) => ExprPrecedence :: Closure ,
@@ -1423,10 +1423,10 @@ pub enum ExprKind {
14231423 While ( P < Expr > , P < Block > , Option < Label > ) ,
14241424 /// A `for` loop, with an optional label.
14251425 ///
1426- /// `'label: for pat in expr { block }`
1426+ /// `'label: for await? pat in iter { block }`
14271427 ///
14281428 /// 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 } ,
14301430 /// Conditionless loop (can be exited with `break`, `continue`, or `return`).
14311431 ///
14321432 /// `'label: loop { block }`
@@ -1529,6 +1529,13 @@ pub enum ExprKind {
15291529 Err ,
15301530}
15311531
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+
15321539/// Used to differentiate between `async {}` blocks and `gen {}` blocks.
15331540#[ derive( Clone , Encodable , Decodable , Debug , PartialEq , Eq ) ]
15341541pub enum GenBlockKind {
0 commit comments