@@ -131,7 +131,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
131131 Coerce { fcx, cause, allow_two_phase, use_lub : false , coerce_never }
132132 }
133133
134- fn unify ( & self , a : Ty < ' tcx > , b : Ty < ' tcx > ) -> InferResult < ' tcx , Ty < ' tcx > > {
134+ fn unify_raw ( & self , a : Ty < ' tcx > , b : Ty < ' tcx > ) -> InferResult < ' tcx , Ty < ' tcx > > {
135135 debug ! ( "unify(a: {:?}, b: {:?}, use_lub: {})" , a, b, self . use_lub) ;
136136 self . commit_if_ok ( |_| {
137137 let at = self . at ( & self . cause , self . fcx . param_env ) ;
@@ -166,7 +166,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
166166 where
167167 F : FnOnce ( Ty < ' tcx > ) -> Vec < Adjustment < ' tcx > > ,
168168 {
169- self . unify ( a, b)
169+ self . unify_raw ( a, b)
170170 . and_then ( |InferOk { value : ty, obligations } | success ( f ( ty) , ty, obligations) )
171171 }
172172
@@ -431,7 +431,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
431431 referent_ty,
432432 mutbl_b, // [1] above
433433 ) ;
434- match self . unify ( derefd_ty_a, b) {
434+ match self . unify_raw ( derefd_ty_a, b) {
435435 Ok ( ok) => {
436436 found = Some ( ok) ;
437437 break ;
@@ -1096,9 +1096,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10961096 let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
10971097 // We don't ever need two-phase here since we throw out the result of the coercion.
10981098 let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No , true ) ;
1099- coerce
1100- . autoderef ( DUMMY_SP , expr_ty )
1101- . find_map ( | ( ty , steps ) | self . probe ( |_| coerce . unify ( ty , target ) ) . ok ( ) . map ( |_| steps ) )
1099+ coerce. autoderef ( DUMMY_SP , expr_ty ) . find_map ( | ( ty , steps ) | {
1100+ self . probe ( |_| coerce . unify_raw ( ty , target ) ) . ok ( ) . map ( |_| steps )
1101+ } )
11021102 }
11031103
11041104 /// Given a type, this function will calculate and return the type given
0 commit comments