# Function rustc_hir_analysis::coherence::orphan::orphan_check

source ·

    fn orphan_check<'tcx>(
        tcx: TyCtxt<'tcx>,
        impl_def_id: LocalDefId,
        mode: OrphanCheckMode,
    ) -> Result<(), OrphanCheckErr<'tcx, FxIndexSet<DefId>>>

Expand description

Checks the coherence orphan rules.

`impl_def_id` should be the `DefId` of a trait impl.

To pass, either the trait must be local, or else two conditions must be satisfied:

1. All type parameters in `Self` must be “covered” by some local type constructor.
2. Some local type must appear in `Self`.