diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 59e3ef4d0fcbb..831edcd88c11b 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -637,10 +637,8 @@ impl<'a> Parser<'a> { match &mut stmt.kind { // Expression without semicolon. StmtKind::Expr(expr) - if match expr.kind { - ExprKind::MacCall(_) => true, - _ => classify::expr_requires_semi_to_be_stmt(expr), - } && !expr.attrs.is_empty() + if classify::expr_requires_semi_to_be_stmt(expr) + && !expr.attrs.is_empty() && ![token::Eof, token::Semi, token::CloseDelim(Delimiter::Brace)] .contains(&self.token.kind) => { @@ -653,11 +651,7 @@ impl<'a> Parser<'a> { // Expression without semicolon. StmtKind::Expr(expr) - if self.token != token::Eof - && match expr.kind { - ExprKind::MacCall(_) => true, - _ => classify::expr_requires_semi_to_be_stmt(expr), - } => + if self.token != token::Eof && classify::expr_requires_semi_to_be_stmt(expr) => { // Just check for errors and recover; do not eat semicolon yet. // `expect_one_of` returns PResult<'a, bool /* recovered */>