File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
compiler/rustc_ast_pretty/src/pprust/state Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -470,11 +470,8 @@ impl<'a> State<'a> {
470470 //
471471 // Same applies to a small set of other expression kinds which eagerly
472472 // terminate a statement which opens with them.
473- let needs_par = fixup. leftmost_subexpression_in_stmt
474- && match expr. kind {
475- ast:: ExprKind :: MacCall ( _) => false ,
476- _ => !classify:: expr_requires_semi_to_be_stmt ( expr) ,
477- } ;
473+ let needs_par =
474+ fixup. leftmost_subexpression_in_stmt && !classify:: expr_requires_semi_to_be_stmt ( expr) ;
478475 if needs_par {
479476 self . popen ( ) ;
480477 fixup = FixupContext :: default ( ) ;
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ fn test_expr() {
226226 ) ;
227227 c2_match_arm ! (
228228 [ m! { } - 1 ] ,
229- "match () { _ => m! {} - 1, }" ,
229+ "match () { _ => ( m! {}) - 1, }" , // parenthesis is redundant
230230 "match() { _ => m! {} - 1 }" ,
231231 ) ;
232232
@@ -748,7 +748,7 @@ fn test_stmt() {
748748 ) ;
749749 c2_minus_one ! (
750750 [ m! { } ] ,
751- "m! {} - 1;" , // FIXME(dtolnay): needs parens, otherwise this is 2 separate statements
751+ "( m! {}) - 1;" ,
752752 "m! {} - 1"
753753 ) ;
754754
You can’t perform that action at this time.
0 commit comments