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> {
1238
1238
if let Some ( ( init, els) ) = loc. kind . init_else_opt ( ) {
1239
1239
self . nbsp ( ) ;
1240
1240
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
+ ) ;
1242
1246
if let Some ( els) = els {
1243
1247
self . cbox ( INDENT_UNIT ) ;
1244
1248
self . ibox ( INDENT_UNIT ) ;
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ macro_rules! expr { ($e:expr) => { $e }; }
11
11
12
12
fn main() {
13
13
let _ = 1 + 1 else { return; };
14
- let _ = loop {} else { return; };
14
+ let _ = ( loop {}) else { return; };
15
15
}
You can’t perform that action at this time.
0 commit comments