diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-30 16:23:29 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-03 12:46:51 +1000 |
| commit | 9af08429f13059fee07a6cb4b019e2bcda3a8093 (patch) | |
| tree | 5269865a9e05f0097f344f11a5a348d8681ab3cb /compiler | |
| parent | 809e5b5ed17f6cede5945939bb7f10c5282d9b53 (diff) | |
| download | rust-9af08429f13059fee07a6cb4b019e2bcda3a8093.tar.gz rust-9af08429f13059fee07a6cb4b019e2bcda3a8093.zip | |
Avoid an indent for labelled loops.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state/expr.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs index abcbb88aab2..c9a7e2aebd0 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs @@ -485,12 +485,12 @@ impl<'a> State<'a> { self.print_block_with_attrs(body, attrs, cb, ib); } ast::ExprKind::Loop(blk, opt_label, _) => { + let cb = self.cbox(0); + let ib = self.ibox(0); if let Some(label) = opt_label { self.print_ident(label.ident); self.word_space(":"); } - let cb = self.cbox(0); - let ib = self.ibox(0); self.word_nbsp("loop"); self.print_block_with_attrs(blk, attrs, cb, ib); } diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 0916885cb17..09bf84ab64f 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -1526,12 +1526,12 @@ impl<'a> State<'a> { self.print_if(test, blk, elseopt); } hir::ExprKind::Loop(blk, opt_label, _, _) => { + let cb = self.cbox(0); + let ib = self.ibox(0); if let Some(label) = opt_label { self.print_ident(label.ident); self.word_space(":"); } - let cb = self.cbox(0); - let ib = self.ibox(0); self.word_nbsp("loop"); self.print_block(blk, cb, ib); } |
