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.
This commit is contained in:
parent
7f2ffbdbc6
commit
d9bb73331e
@ -1253,10 +1253,7 @@ fn print_stmt(&mut self, st: &ast::Stmt) {
|
||||
ast::StmtKind::Expr(expr) => {
|
||||
self.space_if_not_bol();
|
||||
self.print_expr_outer_attr_style(expr, false, FixupContext::new_stmt());
|
||||
if match expr.kind {
|
||||
ast::ExprKind::MacCall(_) => true,
|
||||
_ => classify::expr_requires_semi_to_be_stmt(expr),
|
||||
} {
|
||||
if classify::expr_requires_semi_to_be_stmt(expr) {
|
||||
self.word(";");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user