Skip to content

Commit 448868a

Browse files
committed
Tweak docs
1 parent 9f8306e commit 448868a

File tree

1 file changed

+4
-5
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+4
-5
lines changed

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,15 +1993,14 @@ impl<'tcx> TyCtxt<'tcx> {
19931993
self.def_kind(def_id).is_assoc().then(|| self.parent(def_id))
19941994
}
19951995

1996-
/// If the given `DefId` describes an item belonging to a trait,
1997-
/// returns the `DefId` of the trait that the trait item belongs to;
1998-
/// otherwise, returns `None`.
1996+
/// If the given `DefId` is an associated item of a trait,
1997+
/// returns the `DefId` of the trait; otherwise, returns `None`.
19991998
pub fn trait_of_assoc(self, def_id: DefId) -> Option<DefId> {
20001999
self.assoc_parent(def_id).filter(|id| self.def_kind(id) == DefKind::Trait)
20012000
}
20022001

2003-
/// If the given `DefId` describes a method belonging to an impl, returns the
2004-
/// `DefId` of the impl that the method belongs to; otherwise, returns `None`.
2002+
/// If the given `DefId` is an associated item of an impl,
2003+
/// returns the `DefId` of the impl; otherwise returns `None`.
20052004
pub fn impl_of_assoc(self, def_id: DefId) -> Option<DefId> {
20062005
self.assoc_parent(def_id).filter(|id| matches!(self.def_kind(id), DefKind::Impl { .. }))
20072006
}

0 commit comments

Comments
 (0)