Skip to content

Commit dc5ec72

Browse files
committed
Rearrange logic of needs_par computation in print_let
True || needs_par_as_let_scrutinee(...) is always true.
1 parent 8d64961 commit dc5ec72

File tree

1 file changed

+5
-2
lines changed
  • compiler/rustc_ast_pretty/src/pprust

1 file changed

+5
-2
lines changed

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,11 @@ impl<'a> State<'a> {
11661166
| ast::ExprKind::Closure(..)
11671167
| ast::ExprKind::Ret(..)
11681168
| ast::ExprKind::Yeet(..) => true,
1169-
_ => parser::contains_exterior_struct_lit(expr),
1170-
} || parser::needs_par_as_let_scrutinee(expr.precedence().order()),
1169+
_ => {
1170+
parser::contains_exterior_struct_lit(expr)
1171+
|| parser::needs_par_as_let_scrutinee(expr.precedence().order())
1172+
}
1173+
},
11711174
);
11721175
}
11731176

0 commit comments

Comments
 (0)