diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 74f2a2b2e09..6c70cafb01f 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -2135,22 +2135,20 @@ impl<'a> State<'a> { ast::ExprKind::Path(Some(ref qself), ref path) => self.print_qpath(path, qself, true), ast::ExprKind::Break(opt_label, ref opt_expr) => { self.word("break"); - self.space(); if let Some(label) = opt_label { - self.print_ident(label.ident); self.space(); + self.print_ident(label.ident); } if let Some(ref expr) = *opt_expr { - self.print_expr_maybe_paren(expr, parser::PREC_JUMP); self.space(); + self.print_expr_maybe_paren(expr, parser::PREC_JUMP); } } ast::ExprKind::Continue(opt_label) => { self.word("continue"); - self.space(); if let Some(label) = opt_label { + self.space(); self.print_ident(label.ident); - self.space() } } ast::ExprKind::Ret(ref result) => { diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 4240a4045a1..c3601d0997c 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -1543,22 +1543,20 @@ impl<'a> State<'a> { hir::ExprKind::Path(ref qpath) => self.print_qpath(qpath, true), hir::ExprKind::Break(destination, ref opt_expr) => { self.word("break"); - self.space(); if let Some(label) = destination.label { - self.print_ident(label.ident); self.space(); + self.print_ident(label.ident); } if let Some(ref expr) = *opt_expr { - self.print_expr_maybe_paren(expr, parser::PREC_JUMP); self.space(); + self.print_expr_maybe_paren(expr, parser::PREC_JUMP); } } hir::ExprKind::Continue(destination) => { self.word("continue"); - self.space(); if let Some(label) = destination.label { + self.space(); self.print_ident(label.ident); - self.space() } } hir::ExprKind::Ret(ref result) => { |
