about summary refs log tree commit diff
path: root/compiler/rustc_ast_pretty/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_ast_pretty/src')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state.rs5
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/fixup.rs6
2 files changed, 9 insertions, 2 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs
index be98b7d37d4..fe17ff41bc3 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state.rs
@@ -1253,7 +1253,10 @@ impl<'a> State<'a> {
             ast::StmtKind::Expr(expr) => {
                 self.space_if_not_bol();
                 self.print_expr_outer_attr_style(expr, false, FixupContext::new_stmt());
-                if classify::expr_requires_semi_to_be_stmt_FIXME(expr) {
+                if match expr.kind {
+                    ast::ExprKind::MacCall(_) => true,
+                    _ => classify::expr_requires_semi_to_be_stmt(expr),
+                } {
                     self.word(";");
                 }
             }
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/fixup.rs b/compiler/rustc_ast_pretty/src/pprust/state/fixup.rs
index 363243215a3..9934f972f9b 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/fixup.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/fixup.rs
@@ -128,7 +128,11 @@ impl FixupContext {
     /// The documentation on `FixupContext::leftmost_subexpression_in_stmt` has
     /// examples.
     pub fn would_cause_statement_boundary(self, expr: &Expr) -> bool {
-        self.leftmost_subexpression_in_stmt && !classify::expr_requires_semi_to_be_stmt_FIXME(expr)
+        self.leftmost_subexpression_in_stmt
+            && match expr.kind {
+                ExprKind::MacCall(_) => false,
+                _ => !classify::expr_requires_semi_to_be_stmt(expr),
+            }
     }
 
     /// Determine whether parentheses are needed around the given `let`