diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:25 +0000 |
commit | 5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch) | |
tree | 35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /compiler/rustc_hir_pretty/src | |
parent | Adding debian version 1.66.0+dfsg1-1. (diff) | |
download | rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip |
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_hir_pretty/src')
-rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index da27554a2..94bab9f33 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -398,7 +398,7 @@ impl<'a> State<'a> { } hir::ForeignItemKind::Static(t, m) => { self.head("static"); - if m == hir::Mutability::Mut { + if m.is_mut() { self.word_space("mut"); } self.print_ident(item.ident); @@ -519,7 +519,7 @@ impl<'a> State<'a> { } hir::ItemKind::Static(ty, m, expr) => { self.head("static"); - if m == hir::Mutability::Mut { + if m.is_mut() { self.word_space("mut"); } self.print_ident(item.ident); @@ -695,19 +695,8 @@ impl<'a> State<'a> { self.head("trait"); self.print_ident(item.ident); self.print_generic_params(generics.params); - let mut real_bounds = Vec::with_capacity(bounds.len()); - // FIXME(durka) this seems to be some quite outdated syntax - for b in bounds { - if let GenericBound::Trait(ptr, hir::TraitBoundModifier::Maybe) = b { - self.space(); - self.word_space("for ?"); - self.print_trait_ref(&ptr.trait_ref); - } else { - real_bounds.push(b); - } - } self.nbsp(); - self.print_bounds("=", real_bounds); + self.print_bounds("=", bounds); self.print_where_clause(generics); self.word(";"); self.end(); // end inner head-block @@ -754,7 +743,7 @@ impl<'a> State<'a> { for v in variants { self.space_if_not_bol(); self.maybe_print_comment(v.span.lo()); - self.print_outer_attributes(self.attrs(v.id)); + self.print_outer_attributes(self.attrs(v.hir_id)); self.ibox(INDENT_UNIT); self.print_variant(v); self.word(","); @@ -1480,7 +1469,9 @@ impl<'a> State<'a> { fn_decl, body, fn_decl_span: _, + fn_arg_span: _, movability: _, + def_id: _, }) => { self.print_closure_binder(binder, bound_generic_params); self.print_capture_clause(capture_clause); @@ -1590,7 +1581,7 @@ impl<'a> State<'a> { self.print_ident(Ident::with_dummy_span(name)) } - pub fn print_path(&mut self, path: &hir::Path<'_>, colons_before_params: bool) { + pub fn print_path<R>(&mut self, path: &hir::Path<'_, R>, colons_before_params: bool) { self.maybe_print_comment(path.span.lo()); for (i, segment) in path.segments.iter().enumerate() { @@ -2158,7 +2149,7 @@ impl<'a> State<'a> { } pub fn print_lifetime(&mut self, lifetime: &hir::Lifetime) { - self.print_ident(lifetime.name.ident()) + self.print_ident(lifetime.ident) } pub fn print_where_clause(&mut self, generics: &hir::Generics<'_>) { |