pub fn impl_trait_ref_and_oblig<'a, 'gcx, 'tcx>(selcx: &mut SelectionContext<'a, 'gcx, 'tcx>,
                                                impl_def_id: DefId,
                                                impl_substs: &Substs<'tcx>)
                                                -> (ty::TraitRef<'tcx>,
                                                    Vec<PredicateObligation<'tcx>>)
{
    let impl_trait_ref =
        selcx.tcx().impl_trait_ref(impl_def_id).unwrap();
    let impl_trait_ref =
        impl_trait_ref.subst(selcx.tcx(), impl_substs);
    let Normalized { value: impl_trait_ref, obligations: normalization_obligations1 } =
        super::normalize(selcx, ObligationCause::dummy(), &impl_trait_ref);

    let predicates = selcx.tcx().predicates_of(impl_def_id);
    let predicates = predicates.instantiate(selcx.tcx(), impl_substs);
    let Normalized { value: predicates, obligations: normalization_obligations2 } =
        super::normalize(selcx, ObligationCause::dummy(), &predicates);
    let impl_obligations =
        predicates_for_generics(ObligationCause::dummy(), 0, &predicates);

    let impl_obligations: Vec<_> =
        impl_obligations.into_iter()
        .chain(normalization_obligations1)
        .chain(normalization_obligations2)
        .collect();

    (impl_trait_ref, impl_obligations)
}
/// Instantiate all bound parameters of the impl with the given substs,
/// returning the resulting trait ref and all obligations that arise.
/// The obligations are closed under normalization.
Instantiate all bound parameters of the impl with the given substs,
returning the resulting trait ref and all obligations that arise.
The obligations are closed under normalization.
Instantiate all bound parameters of the impl with the given substs returning the resulting trait ref and all obligations that arise . The obligations are closed under normalization .
pub fn impl_trait_ref_and_oblig<'a, 'gcx, 'tcx>(selcx: &mut SelectionContext<'a, 'gcx, 'tcx>,
                                                impl_def_id: DefId,
                                                impl_substs: &Substs<'tcx>)
                                                -> (ty::TraitRef<'tcx>,
                                                    Vec<PredicateObligation<'tcx>>)
{
    let impl_trait_ref =
        selcx.tcx().impl_trait_ref(impl_def_id).unwrap();
    let impl_trait_ref =
        impl_trait_ref.subst(selcx.tcx(), impl_substs);
    let Normalized { value: impl_trait_ref, obligations: normalization_obligations1 } =
        super::normalize(selcx, ObligationCause::dummy(), &impl_trait_ref);
    let predicates = selcx.tcx().predicates_of(impl_def_id);
    let predicates = predicates.instantiate(selcx.tcx(), impl_substs);
    let Normalized { value: predicates, obligations: normalization_obligations2 } =
        super::normalize(selcx, ObligationCause::dummy(), &predicates);
    let impl_obligations =
        predicates_for_generics(ObligationCause::dummy(), 0, &predicates);
    let impl_obligations: Vec<_> =
        impl_obligations.into_iter()
        .chain(normalization_obligations1)
        .chain(normalization_obligations2)
        .collect();
    (impl_trait_ref, impl_obligations)
}
pub fn impl_trait_ref_and_oblig < ' a , ' gcx , ' tcx > ( selcx : & mut SelectionContext < ' a , ' gcx , ' tcx > , impl_def_id : DefId , impl_substs : & Substs < ' tcx > ) -> ( ty :: TraitRef < ' tcx > , Vec < PredicateObligation < ' tcx > > ) { let impl_trait_ref = selcx . tcx ( ) . impl_trait_ref ( impl_def_id ) . unwrap ( ) ; let impl_trait_ref = impl_trait_ref . subst ( selcx . tcx ( ) , impl_substs ) ; let Normalized { value : impl_trait_ref , obligations : normalization_obligations1 } = super :: normalize ( selcx , ObligationCause :: dummy ( ) , & impl_trait_ref ) ; let predicates = selcx . tcx ( ) . predicates_of ( impl_def_id ) ; let predicates = predicates . instantiate ( selcx . tcx ( ) , impl_substs ) ; let Normalized { value : predicates , obligations : normalization_obligations2 } = super :: normalize ( selcx , ObligationCause :: dummy ( ) , & predicates ) ; let impl_obligations = predicates_for_generics ( ObligationCause :: dummy ( ) , 0 , & predicates ) ; let impl_obligations : Vec < _ > = impl_obligations . into_iter ( ) . chain ( normalization_obligations1 ) . chain ( normalization_obligations2 ) . collect ( ) ; ( impl_trait_ref , impl_obligations ) }
Instantiate all bound parameters of the impl with the given substs,
returning the resulting trait ref and all obligations that arise.
Instantiate all bound parameters of the impl with the given substs returning the resulting trait ref and all obligations that arise .
selcx
&mut SelectionContext<'a, 'gcx, 'tcx>
impl_def_id
DefId
impl_substs
&Substs<'tcx>
selcx
&mut SelectionContext<'a, 'gcx, 'tcx>
impl_def_id
DefId
impl_substs
&Substs<'tcx>