From 172af038a733020ec487d57a593ddb27ce16c325 Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Thu, 24 Jul 2025 19:05:31 -0500 Subject: Rename trait_of_item -> trait_of_assoc --- compiler/rustc_middle/src/ty/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 55606557770..2e4bad290d7 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1996,7 +1996,7 @@ impl<'tcx> TyCtxt<'tcx> { /// If the given `DefId` describes an item belonging to a trait, /// returns the `DefId` of the trait that the trait item belongs to; /// otherwise, returns `None`. - pub fn trait_of_item(self, def_id: DefId) -> Option { + pub fn trait_of_assoc(self, def_id: DefId) -> Option { self.assoc_parent(def_id).filter(|id| self.def_kind(id) == DefKind::Trait) } @@ -2174,7 +2174,7 @@ impl<'tcx> TyCtxt<'tcx> { #[inline] pub fn is_const_default_method(self, def_id: DefId) -> bool { - matches!(self.trait_of_item(def_id), Some(trait_id) if self.is_const_trait(trait_id)) + matches!(self.trait_of_assoc(def_id), Some(trait_id) if self.is_const_trait(trait_id)) } pub fn impl_method_has_trait_impl_trait_tys(self, def_id: DefId) -> bool { -- cgit 1.4.1-3-g733a5