@@ -1278,19 +1278,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
12781278 let normalized_term =
12791279 ocx. normalize ( & obligation. cause , obligation. param_env , unnormalized_term) ;
12801280
1281- let is_normalized_term_expected = !matches ! (
1282- obligation. cause. code( ) . peel_derives( ) ,
1283- ObligationCauseCode :: WhereClause ( ..)
1284- | ObligationCauseCode :: WhereClauseInExpr ( ..)
1285- | ObligationCauseCode :: Coercion { .. }
1286- ) ;
1287-
1288- let ( expected, actual) = if is_normalized_term_expected {
1289- ( normalized_term, data. term )
1290- } else {
1291- ( data. term , normalized_term)
1292- } ;
1293-
12941281 // constrain inference variables a bit more to nested obligations from normalize so
12951282 // we can have more helpful errors.
12961283 //
@@ -1299,12 +1286,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
12991286 let _ = ocx. select_where_possible ( ) ;
13001287
13011288 if let Err ( new_err) =
1302- ocx. eq ( & obligation. cause , obligation. param_env , expected , actual )
1289+ ocx. eq ( & obligation. cause , obligation. param_env , data . term , normalized_term )
13031290 {
13041291 (
13051292 Some ( (
13061293 data. projection_term ,
1307- is_normalized_term_expected ,
1294+ false ,
13081295 self . resolve_vars_if_possible ( normalized_term) ,
13091296 data. term ,
13101297 ) ) ,
@@ -1444,12 +1431,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
14441431 & mut diag,
14451432 & obligation. cause ,
14461433 secondary_span,
1447- values. map ( |( _, is_normalized_ty_expected, normalized_ty, expected_ty) | {
1448- infer:: ValuePairs :: Terms ( ExpectedFound :: new (
1449- is_normalized_ty_expected,
1450- normalized_ty,
1451- expected_ty,
1452- ) )
1434+ values. map ( |( _, _, normalized_ty, expected_ty) | {
1435+ infer:: ValuePairs :: Terms ( ExpectedFound :: new ( true , expected_ty, normalized_ty) )
14531436 } ) ,
14541437 err,
14551438 true ,
0 commit comments