File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments