trait_impls_for

Function trait_impls_for 

Source
fn trait_impls_for<'tcx>(
    tcx: TyCtxt<'tcx>,
    ty: Ty<'tcx>,
    module: DefId,
) -> FxIndexSet<(DefId, DefId)>
Expand description

Given a type, return all trait impls in scope in module for that type. Returns a set of pairs of (impl_id, trait_id).

NOTE: this cannot be a query because more traits could be available when more crates are compiled! So it is not stable to serialize cross-crate.