From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_ast_pretty/src/pprust/state.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_ast_pretty/src/pprust/state.rs') diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 694d688bf..849336c86 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -686,7 +686,7 @@ pub trait PrintState<'a>: std::ops::Deref + std::ops::Dere fn bclose_maybe_open(&mut self, span: rustc_span::Span, empty: bool, close_box: bool) { let has_comment = self.maybe_print_comment(span.hi()); if !empty || has_comment { - self.break_offset_if_not_bol(1, -(INDENT_UNIT as isize)); + self.break_offset_if_not_bol(1, -INDENT_UNIT); } self.word("}"); if close_box { @@ -984,7 +984,9 @@ impl<'a> State<'a> { pub fn print_assoc_constraint(&mut self, constraint: &ast::AssocConstraint) { self.print_ident(constraint.ident); - constraint.gen_args.as_ref().map(|args| self.print_generic_args(args, false)); + if let Some(args) = constraint.gen_args.as_ref() { + self.print_generic_args(args, false) + } self.space(); match &constraint.kind { ast::AssocConstraintKind::Equality { term } => { -- cgit v1.2.3