[−][src]Function rustc::ty::trait_of_item
fn trait_of_item<'a, 'tcx>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId
) -> Option<DefId>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
If the given def ID describes an item belonging to a trait,
return the ID of the trait that the trait item belongs to.
Otherwise, return None
.