[−][src]Function rustc_typeck::check::compare_method::check_type_bounds

pub fn check_type_bounds<'tcx>(
    tcx: TyCtxt<'tcx>,
    trait_ty: &AssocItem,
    impl_ty: &AssocItem,
    impl_ty_span: Span,
    impl_trait_ref: TraitRef<'tcx>
) -> Result<(), ErrorReported>

Validate that ProjectionCandidates created for this associated type will be valid.

Usually given

trait X { type Y: Copy } impl X for T { type Y = S; }

We are able to normalize <T as X>::U to S, and so when we check the impl is well-formed we have to prove S: Copy.

For default associated types the normalization is not possible (the value from the impl could be overridden). We also can't normalize generic associated types (yet) because they contain bound parameters.