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> {
1993
1993
self . def_kind ( def_id) . is_assoc ( ) . then ( || self . parent ( def_id) )
1994
1994
}
1995
1995
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`.
1999
1998
pub fn trait_of_assoc ( self , def_id : DefId ) -> Option < DefId > {
2000
1999
self . assoc_parent ( def_id) . filter ( |id| self . def_kind ( id) == DefKind :: Trait )
2001
2000
}
2002
2001
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`.
2005
2004
pub fn impl_of_assoc ( self , def_id : DefId ) -> Option < DefId > {
2006
2005
self . assoc_parent ( def_id) . filter ( |id| matches ! ( self . def_kind( id) , DefKind :: Impl { .. } ) )
2007
2006
}
You can’t perform that action at this time.
0 commit comments