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 {
128
128
/// The documentation on `FixupContext::leftmost_subexpression_in_stmt` has
129
129
/// examples.
130
130
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)
136
132
}
137
133
138
134
/// 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() {
225
225
) ;
226
226
c2_match_arm ! (
227
227
[ m! { } - 1 ] ,
228
- "match () { _ => m! {} - 1, }" ,
228
+ "match () { _ => ( m! {}) - 1, }" , // parenthesis is redundant
229
229
"match () { _ => m! {} - 1 }" ,
230
230
) ;
231
231
@@ -747,7 +747,7 @@ fn test_stmt() {
747
747
) ;
748
748
c2_minus_one ! (
749
749
[ m! { } ] ,
750
- "m! {} - 1;" , // FIXME(dtolnay): needs parens, otherwise this is 2 separate statements
750
+ "( m! {}) - 1;" ,
751
751
"m! {} - 1"
752
752
) ;
753
753
You can’t perform that action at this time.
0 commit comments