File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
compiler/rustc_ast_pretty/src/pprust Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1238,7 +1238,11 @@ impl<'a> State<'a> {
12381238 if let Some ( ( init, els) ) = loc. kind . init_else_opt ( ) {
12391239 self . nbsp ( ) ;
12401240 self . word_space ( "=" ) ;
1241- self . print_expr ( init, FixupContext :: default ( ) ) ;
1241+ self . print_expr_cond_paren (
1242+ init,
1243+ els. is_some ( ) && classify:: expr_trailing_brace ( init) . is_some ( ) ,
1244+ FixupContext :: default ( ) ,
1245+ ) ;
12421246 if let Some ( els) = els {
12431247 self . cbox ( INDENT_UNIT ) ;
12441248 self . ibox ( INDENT_UNIT ) ;
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ macro_rules! expr { ($e:expr) => { $e }; }
1111
1212fn main() {
1313 let _ = 1 + 1 else { return; };
14- let _ = loop {} else { return; };
14+ let _ = ( loop {}) else { return; };
1515}
You can’t perform that action at this time.
0 commit comments