Rollup merge of #124269 - scrabsha:sasha/fix-124206, r=dtolnay

Pretty-print parenthesis around binary in postfix match

Fixes #124206.
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-04-29 18:03:22 +01:00 committed by GitHub
commit f1c53da1cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 69 additions and 1 deletions

View file

@ -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");
}
}