File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
compiler/rustc_ast_pretty/src/pprust/state Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -128,11 +128,7 @@ impl FixupContext {
128128 /// The documentation on `FixupContext::leftmost_subexpression_in_stmt` has
129129 /// examples.
130130 pub fn would_cause_statement_boundary ( self , expr : & Expr ) -> bool {
131- self . leftmost_subexpression_in_stmt
132- && match expr. kind {
133- ExprKind :: MacCall ( _) => false ,
134- _ => !classify:: expr_requires_semi_to_be_stmt ( expr) ,
135- }
131+ self . leftmost_subexpression_in_stmt && !classify:: expr_requires_semi_to_be_stmt ( expr)
136132 }
137133
138134 /// Determine whether parentheses are needed around the given `let`
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ fn test_expr() {
225225 ) ;
226226 c2_match_arm ! (
227227 [ m! { } - 1 ] ,
228- "match () { _ => m! {} - 1, }" ,
228+ "match () { _ => ( m! {}) - 1, }" , // parenthesis is redundant
229229 "match () { _ => m! {} - 1 }" ,
230230 ) ;
231231
@@ -747,7 +747,7 @@ fn test_stmt() {
747747 ) ;
748748 c2_minus_one ! (
749749 [ m! { } ] ,
750- "m! {} - 1;" , // FIXME(dtolnay): needs parens, otherwise this is 2 separate statements
750+ "( m! {}) - 1;" ,
751751 "m! {} - 1"
752752 ) ;
753753
You can’t perform that action at this time.
0 commit comments