Skip to content

Commit b67a803

Browse files
committed
Delete MacCall case from pretty-printing semicolon after StmtKind::Expr
I didn't figure out how to reach this condition with `expr` containing `ExprKind::MacCall`. All the approaches I tried ended up with the macro call ending up in the `StmtKind::MacCall` case below instead. In any case, from visual inspection this is a bugfix. If we do end up with a `StmtKind::Expr` containing `ExprKind::MacCall` with brace delimiter, it would not need ";" printed after it.
1 parent ad47776 commit b67a803

File tree

1 file changed

+1
-4
lines changed
  • compiler/rustc_ast_pretty/src/pprust

1 file changed

+1
-4
lines changed

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,10 +1253,7 @@ impl<'a> State<'a> {
12531253
ast::StmtKind::Expr(expr) => {
12541254
self.space_if_not_bol();
12551255
self.print_expr_outer_attr_style(expr, false, FixupContext::new_stmt());
1256-
if match expr.kind {
1257-
ast::ExprKind::MacCall(_) => true,
1258-
_ => classify::expr_requires_semi_to_be_stmt(expr),
1259-
} {
1256+
if classify::expr_requires_semi_to_be_stmt(expr) {
12601257
self.word(";");
12611258
}
12621259
}

0 commit comments

Comments
 (0)