summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_hir_pretty
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
commit4547b622d8d29df964fa2914213088b148c498fc (patch)
tree9fc6b25f3c3add6b745be9a2400a6e96140046e9 /compiler/rustc_hir_pretty
parentReleasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz
rustc-4547b622d8d29df964fa2914213088b148c498fc.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')
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs25
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<'_>) {