[−][src]Function rustc_ty_utils::ty::trait_of_item

pub(in ty) fn trait_of_item(
    tcx: TyCtxt<'_>,
    def_id: DefId
) -> Option<DefId>

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.