Skip to content

Commit f2a1795

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 ff6c7c5 commit f2a1795

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
@@ -1101,10 +1101,7 @@ impl<'a> State<'a> {
11011101
false,
11021102
FixupContext { stmt: true, ..FixupContext::default() },
11031103
);
1104-
if match expr.kind {
1105-
ast::ExprKind::MacCall(_) => true,
1106-
_ => classify::expr_requires_semi_to_be_stmt(expr),
1107-
} {
1104+
if classify::expr_requires_semi_to_be_stmt(expr) {
11081105
self.word(";");
11091106
}
11101107
}

0 commit comments

Comments
 (0)