fn confirm(&mut self,
               obligation_cause: ObligationCause,
               obligation_trait_ref: Rc<ty::TraitRef<'tcx>>,
               expected_trait_ref: Rc<ty::TraitRef<'tcx>>)
               -> Result<(), SelectionError<'tcx>>
    {
        let origin = infer::RelateOutputImplTypes(obligation_cause.span);

        let obligation_trait_ref = obligation_trait_ref.clone();
        match self.infcx.sub_trait_refs(false,
                                        origin,
                                        expected_trait_ref.clone(),
                                        obligation_trait_ref) {
            Ok(()) => Ok(()),
            Err(e) => Err(OutputTypeParameterMismatch(expected_trait_ref, e))
        }
    }
/// After we have determined which impl applies, and with what substitutions, there is one last
/// step. We have to go back and relate the "output" type parameters from the obligation to the
/// types that are specified in the impl.
///
/// For example, imagine we have:
///
///     impl<T> Iterator<T> for Vec<T> { ... }
///
/// and our obligation is `Iterator<Foo> for Vec<int>` (note the mismatch in the obligation
/// types). Up until this step, no error would be reported: the self type is `Vec<int>`, and
/// that matches `Vec<T>` with the substitution `T=int`. At this stage, we could then go and
/// check that the type parameters to the `Iterator` trait match. (In terms of the parameters,
/// the `expected_trait_ref` here would be `Iterator<int> for Vec<int>`, and the
/// `obligation_trait_ref` would be `Iterator<Foo> for Vec<int>`.
///
/// Note that this checking occurs *after* the impl has selected, because these output type
/// parameters should not affect the selection of the impl. Therefore, if there is a mismatch,
/// we report an error to the user.
After we have determined which impl applies, and with what substitutions, there is one last
step. We have to go back and relate the "output" type parameters from the obligation to the
types that are specified in the impl.

For example, imagine we have.

impl Iterator for Vec { ...

and our obligation is `Iterator for Vec` (note the mismatch in the obligation
types).

Note that this checking occurs *after* the impl has selected, because these output type
parameters should not affect the selection of the impl. Therefore, if there is a mismatch,
we report an error to the user.
After we have determined which impl applies and with what substitutions there is one last step . We have to go back and relate the " output " type parameters from the obligation to the types that are specified in the impl . For example imagine we have . impl Iterator for Vec { ... and our obligation is ` Iterator for Vec ` ( note the mismatch in the obligation types ) . Note that this checking occurs * after * the impl has selected because these output type parameters should not affect the selection of the impl . Therefore if there is a mismatch we report an error to the user .
fn confirm(&mut self,
               obligation_cause: ObligationCause,
               obligation_trait_ref: Rc<ty::TraitRef<'tcx>>,
               expected_trait_ref: Rc<ty::TraitRef<'tcx>>)
               -> Result<(), SelectionError<'tcx>>
    {
        let origin = infer::RelateOutputImplTypes(obligation_cause.span);
        let obligation_trait_ref = obligation_trait_ref.clone();
        match self.infcx.sub_trait_refs(false,
                                        origin,
                                        expected_trait_ref.clone(),
                                        obligation_trait_ref) {
            Ok(()) => Ok(()),
            Err(e) => Err(OutputTypeParameterMismatch(expected_trait_ref, e))
        }
    }
fn confirm ( & mut self , obligation_cause : ObligationCause , obligation_trait_ref : Rc < ty :: TraitRef < ' tcx > > , expected_trait_ref : Rc < ty :: TraitRef < ' tcx > > ) -> Result < ( ) , SelectionError < ' tcx > > { let origin = infer :: RelateOutputImplTypes ( obligation_cause . span ) ; let obligation_trait_ref = obligation_trait_ref . clone ( ) ; match self . infcx . sub_trait_refs ( false , origin , expected_trait_ref . clone ( ) , obligation_trait_ref ) { Ok ( ( ) ) => Ok ( ( ) ) , Err ( e ) => Err ( OutputTypeParameterMismatch ( expected_trait_ref , e ) ) } }
After we have determined which impl applies, and with what substitutions, there is one last
step.
After we have determined which impl applies and with what substitutions there is one last step .
&mut self
obligation_cause
ObligationCause
obligation_trait_ref
Rc<ty::TraitRef<'tcx>>
expected_trait_ref
Rc<ty::TraitRef<'tcx>>