diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-01-14 13:04:27 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-14 13:04:27 +0100 | 
| commit | 81da2a19fa2adb8bb2828287c2cae1e9c7c51445 (patch) | |
| tree | 5159fdfc3d30d479b83107ea50cfff4a0efc987b /compiler/rustc_parse/src/parser/stmt.rs | |
| parent | 2e30e525ac12a420ec8aea022431075cf9f6a2ce (diff) | |
| parent | f7850c5368de4d477b6484ecee2c3eedb9ba997e (diff) | |
| download | rust-81da2a19fa2adb8bb2828287c2cae1e9c7c51445.tar.gz rust-81da2a19fa2adb8bb2828287c2cae1e9c7c51445.zip  | |
Rollup merge of #106846 - WaffleLapkin:pico_parse_ref, r=TaKO8Ki
Improve some comments and names in parser Just a tiny drive-by cleanup.
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 10 | 
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 1e5c2834960..4ff9927aab5 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -164,7 +164,10 @@ impl<'a> Parser<'a> { // Perform this outside of the `collect_tokens_trailing_token` closure, // since our outer attributes do not apply to this part of the expression let expr = self.with_res(Restrictions::STMT_EXPR, |this| { - this.parse_assoc_expr_with(0, LhsExpr::AlreadyParsed(expr, true)) + this.parse_assoc_expr_with( + 0, + LhsExpr::AlreadyParsed { expr, starts_statement: true }, + ) })?; Ok(self.mk_stmt(lo.to(self.prev_token.span), StmtKind::Expr(expr))) } else { @@ -198,7 +201,10 @@ impl<'a> Parser<'a> { let e = self.mk_expr(lo.to(hi), ExprKind::MacCall(mac)); let e = self.maybe_recover_from_bad_qpath(e)?; let e = self.parse_dot_or_call_expr_with(e, lo, attrs)?; - let e = self.parse_assoc_expr_with(0, LhsExpr::AlreadyParsed(e, false))?; + let e = self.parse_assoc_expr_with( + 0, + LhsExpr::AlreadyParsed { expr: e, starts_statement: false }, + )?; StmtKind::Expr(e) }; Ok(self.mk_stmt(lo.to(hi), kind))  | 
