about summary refs log tree commit diff
path: root/compiler/rustc_ast_pretty/src/pprust/state.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2023-12-29 16:30:34 -0800
committerDavid Tolnay <dtolnay@gmail.com>2024-05-11 15:48:59 -0700
commit9e1cf2098d68356bccf7112bbff1d9b565e80a02 (patch)
treef9b2fa5f5790e5421fa215a2ade0c568052306e8 /compiler/rustc_ast_pretty/src/pprust/state.rs
parentcbb8714a3f8a04cce698719df338fb095c40f479 (diff)
downloadrust-9e1cf2098d68356bccf7112bbff1d9b565e80a02.tar.gz
rust-9e1cf2098d68356bccf7112bbff1d9b565e80a02.zip
Macro call with braces does not require semicolon to be statement
This commit by itself is supposed to have no effect on behavior. All of
the call sites are updated to preserve their previous behavior.

The behavior changes are in the commits that follow.
Diffstat (limited to 'compiler/rustc_ast_pretty/src/pprust/state.rs')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state.rs5
1 files changed, 4 insertions, 1 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(";");
                 }
             }