about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/errors.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-02-20 18:28:48 +0000
committerMichael Goulet <michael@errs.io>2025-02-22 00:13:19 +0000
commit3d5438accdd111b4e507bbfae5e2df6062fb5689 (patch)
treead1ce2c9f163d0077abf245b57ce7a9da5eba2db /compiler/rustc_trait_selection/src/errors.rs
parente1819a889a2606b79dc9cc790205da1497d617b7 (diff)
downloadrust-3d5438accdd111b4e507bbfae5e2df6062fb5689.tar.gz
rust-3d5438accdd111b4e507bbfae5e2df6062fb5689.zip
Fix binding mode problems
Diffstat (limited to 'compiler/rustc_trait_selection/src/errors.rs')
-rw-r--r--compiler/rustc_trait_selection/src/errors.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs
index e8d30d3ee79..96eaf225159 100644
--- a/compiler/rustc_trait_selection/src/errors.rs
+++ b/compiler/rustc_trait_selection/src/errors.rs
@@ -509,21 +509,18 @@ impl Subdiagnostic for AddLifetimeParamsSuggestion<'_> {
             let node = self.tcx.hir_node_by_def_id(anon_reg.scope);
             let is_impl = matches!(&node, hir::Node::ImplItem(_));
             let (generics, parent_generics) = match node {
-                hir::Node::Item(&hir::Item {
-                    kind: hir::ItemKind::Fn { ref generics, .. },
-                    ..
-                })
-                | hir::Node::TraitItem(&hir::TraitItem { ref generics, .. })
-                | hir::Node::ImplItem(&hir::ImplItem { ref generics, .. }) => (
+                hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn { generics, .. }, .. })
+                | hir::Node::TraitItem(hir::TraitItem { generics, .. })
+                | hir::Node::ImplItem(hir::ImplItem { generics, .. }) => (
                     generics,
                     match self.tcx.parent_hir_node(self.tcx.local_def_id_to_hir_id(anon_reg.scope))
                     {
                         hir::Node::Item(hir::Item {
-                            kind: hir::ItemKind::Trait(_, _, ref generics, ..),
+                            kind: hir::ItemKind::Trait(_, _, generics, ..),
                             ..
                         })
                         | hir::Node::Item(hir::Item {
-                            kind: hir::ItemKind::Impl(hir::Impl { ref generics, .. }),
+                            kind: hir::ItemKind::Impl(hir::Impl { generics, .. }),
                             ..
                         }) => Some(generics),
                         _ => None,