fn normalize_associated_type<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
                                             ty: Ty<'gcx>)
                                             -> Ty<'gcx> {
    if !ty.has_projection_types() {
        return ty;
    }

    let mut selcx = traits::SelectionContext::new(infcx);
    let cause = traits::ObligationCause::dummy();
    let traits::Normalized { value: result, obligations } =
        traits::normalize(&mut selcx, cause, &ty);

    let mut fulfill_cx = traits::FulfillmentContext::new();

    for obligation in obligations {
        fulfill_cx.register_predicate_obligation(infcx, obligation);
    }

    infcx.drain_fulfillment_cx_or_panic(DUMMY_SP, &mut fulfill_cx, &result)
}
/// Helper function for normalizing associated types in an inference context.
Helper function for normalizing associated types in an inference context.
Helper function for normalizing associated types in an inference context .
fn normalize_associated_type<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
                                             ty: Ty<'gcx>)
                                             -> Ty<'gcx> {
    if !ty.has_projection_types() {
        return ty;
    }
    let mut selcx = traits::SelectionContext::new(infcx);
    let cause = traits::ObligationCause::dummy();
    let traits::Normalized { value: result, obligations } =
        traits::normalize(&mut selcx, cause, &ty);
    let mut fulfill_cx = traits::FulfillmentContext::new();
    for obligation in obligations {
        fulfill_cx.register_predicate_obligation(infcx, obligation);
    }
    infcx.drain_fulfillment_cx_or_panic(DUMMY_SP, &mut fulfill_cx, &result)
}
fn normalize_associated_type < ' a , ' gcx , ' tcx > ( infcx : & InferCtxt < ' a , ' gcx , ' tcx > , ty : Ty < ' gcx > ) -> Ty < ' gcx > { if ! ty . has_projection_types ( ) { return ty ; } let mut selcx = traits :: SelectionContext :: new ( infcx ) ; let cause = traits :: ObligationCause :: dummy ( ) ; let traits :: Normalized { value : result , obligations } = traits :: normalize ( & mut selcx , cause , & ty ) ; let mut fulfill_cx = traits :: FulfillmentContext :: new ( ) ; for obligation in obligations { fulfill_cx . register_predicate_obligation ( infcx , obligation ) ; } infcx . drain_fulfillment_cx_or_panic ( DUMMY_SP , & mut fulfill_cx , & result ) }
Helper function for normalizing associated types in an inference context.
Helper function for normalizing associated types in an inference context .
infcx
&InferCtxt<'a, 'gcx, 'tcx>
ty
Ty<'gcx>
infcx
&InferCtxt<'a, 'gcx, 'tcx>
ty
Ty<'gcx>