From 277b0ecf3493a89818a4008afbb36ae4e77c1024 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 13 Jul 2025 13:42:02 +0000 Subject: Remove hir::AssocItemKind. --- compiler/rustc_middle/src/ty/assoc.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/ty/assoc.rs b/compiler/rustc_middle/src/ty/assoc.rs index 9534d45e495..1d15e4de7b6 100644 --- a/compiler/rustc_middle/src/ty/assoc.rs +++ b/compiler/rustc_middle/src/ty/assoc.rs @@ -257,6 +257,16 @@ impl AssocItems { self.items.get_by_key(Some(name)) } + /// Returns the associated item with the given identifier and `AssocKind`, if one exists. + /// The identifier is ignoring hygiene. This is meant to be used for lints and diagnostics. + pub fn filter_by_name_unhygienic_and_kind( + &self, + name: Symbol, + assoc_tag: AssocTag, + ) -> impl '_ + Iterator { + self.filter_by_name_unhygienic(name).filter(move |item| item.as_tag() == assoc_tag) + } + /// Returns the associated item with the given identifier and `AssocKind`, if one exists. /// The identifier is matched hygienically. pub fn find_by_ident_and_kind( -- cgit 1.4.1-3-g733a5