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> {
470
470
//
471
471
// Same applies to a small set of other expression kinds which eagerly
472
472
// 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) ;
478
475
if needs_par {
479
476
self . popen ( ) ;
480
477
fixup = FixupContext :: default ( ) ;
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ fn test_expr() {
226
226
) ;
227
227
c2_match_arm ! (
228
228
[ m! { } - 1 ] ,
229
- "match () { _ => m! {} - 1, }" ,
229
+ "match () { _ => ( m! {}) - 1, }" , // parenthesis is redundant
230
230
"match() { _ => m! {} - 1 }" ,
231
231
) ;
232
232
@@ -748,7 +748,7 @@ fn test_stmt() {
748
748
) ;
749
749
c2_minus_one ! (
750
750
[ m! { } ] ,
751
- "m! {} - 1;" , // FIXME(dtolnay): needs parens, otherwise this is 2 separate statements
751
+ "( m! {}) - 1;" ,
752
752
"m! {} - 1"
753
753
) ;
754
754
You can’t perform that action at this time.
0 commit comments