@@ -131,7 +131,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
131
131
Coerce { fcx, cause, allow_two_phase, use_lub : false , coerce_never }
132
132
}
133
133
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 > > {
135
135
debug ! ( "unify(a: {:?}, b: {:?}, use_lub: {})" , a, b, self . use_lub) ;
136
136
self . commit_if_ok ( |_| {
137
137
let at = self . at ( & self . cause , self . fcx . param_env ) ;
@@ -166,7 +166,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
166
166
where
167
167
F : FnOnce ( Ty < ' tcx > ) -> Vec < Adjustment < ' tcx > > ,
168
168
{
169
- self . unify ( a, b)
169
+ self . unify_raw ( a, b)
170
170
. and_then ( |InferOk { value : ty, obligations } | success ( f ( ty) , ty, obligations) )
171
171
}
172
172
@@ -431,7 +431,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
431
431
referent_ty,
432
432
mutbl_b, // [1] above
433
433
) ;
434
- match self . unify ( derefd_ty_a, b) {
434
+ match self . unify_raw ( derefd_ty_a, b) {
435
435
Ok ( ok) => {
436
436
found = Some ( ok) ;
437
437
break ;
@@ -1096,9 +1096,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1096
1096
let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1097
1097
// We don't ever need two-phase here since we throw out the result of the coercion.
1098
1098
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
+ } )
1102
1102
}
1103
1103
1104
1104
/// Given a type, this function will calculate and return the type given
0 commit comments