about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-04-29 18:03:22 +0100
committerGitHub <noreply@github.com>2024-04-29 18:03:22 +0100
commitf1c53da1cf7bcf7e4efbe0b7ae32310e488f1bdf (patch)
tree38fd4ce948f00172d0f5eed24cae109eb254d6ed /compiler
parent7a5867425959b4b5d69334fa6f02150dc2a5d128 (diff)
parentc8ff8a4dc7c9867c54df8f6d31120f4cd3923508 (diff)
downloadrust-f1c53da1cf7bcf7e4efbe0b7ae32310e488f1bdf.tar.gz
rust-f1c53da1cf7bcf7e4efbe0b7ae32310e488f1bdf.zip
Rollup merge of #124269 - scrabsha:sasha/fix-124206, r=dtolnay
Pretty-print parenthesis around binary in postfix match

Fixes #124206.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index 4cbdc9f256d..b5bb781acdf 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -488,7 +488,7 @@ impl<'a> State<'a> {
                         self.space();
                     }
                     MatchKind::Postfix => {
-                        self.print_expr_as_cond(expr);
+                        self.print_expr_maybe_paren(expr, parser::PREC_POSTFIX, fixup);
                         self.word_nbsp(".match");
                     }
                 }