diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2025-07-24 19:01:22 -0500 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2025-07-28 09:54:55 -0500 |
| commit | cdcfdd1a1b3f267a98c693fc03b4411934b60674 (patch) | |
| tree | 10fa37efd86d2107f13b83540063bf952bd24de9 /compiler | |
| parent | b43164cef643957f9e1cd20dffdbb736f3f3c298 (diff) | |
| download | rust-cdcfdd1a1b3f267a98c693fc03b4411934b60674.tar.gz rust-cdcfdd1a1b3f267a98c693fc03b4411934b60674.zip | |
Tweak docs
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 1119e60be85..bb70c61cd14 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1993,15 +1993,14 @@ impl<'tcx> TyCtxt<'tcx> { self.def_kind(def_id).is_assoc().then(|| self.parent(def_id)) } - /// 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`. + /// If the given `DefId` is an associated item of a trait, + /// returns the `DefId` of the trait; otherwise, returns `None`. pub fn trait_of_assoc(self, def_id: DefId) -> Option<DefId> { self.assoc_parent(def_id).filter(|id| self.def_kind(id) == DefKind::Trait) } - /// If the given `DefId` describes a method belonging to an impl, returns the - /// `DefId` of the impl that the method belongs to; otherwise, returns `None`. + /// If the given `DefId` is an associated item of an impl, + /// returns the `DefId` of the impl; otherwise returns `None`. pub fn impl_of_assoc(self, def_id: DefId) -> Option<DefId> { self.assoc_parent(def_id).filter(|id| matches!(self.def_kind(id), DefKind::Impl { .. })) } |
