diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2025-07-13 13:42:02 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2025-07-13 13:50:00 +0000 |
| commit | 277b0ecf3493a89818a4008afbb36ae4e77c1024 (patch) | |
| tree | a443eca26453ce2f89f70ff3a870d137d98ae727 /compiler/rustc_middle | |
| parent | 3ecd03bdfd8da8464e2e381523adb15d60975254 (diff) | |
| download | rust-277b0ecf3493a89818a4008afbb36ae4e77c1024.tar.gz rust-277b0ecf3493a89818a4008afbb36ae4e77c1024.zip | |
Remove hir::AssocItemKind.
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/ty/assoc.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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 @@ -258,6 +258,16 @@ impl AssocItems { } /// 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<Item = &ty::AssocItem> { + 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( &self, |
