@@ -1278,19 +1278,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
1278
1278
let normalized_term =
1279
1279
ocx. normalize ( & obligation. cause , obligation. param_env , unnormalized_term) ;
1280
1280
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
-
1294
1281
// constrain inference variables a bit more to nested obligations from normalize so
1295
1282
// we can have more helpful errors.
1296
1283
//
@@ -1299,12 +1286,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
1299
1286
let _ = ocx. select_where_possible ( ) ;
1300
1287
1301
1288
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 )
1303
1290
{
1304
1291
(
1305
1292
Some ( (
1306
1293
data. projection_term ,
1307
- is_normalized_term_expected ,
1294
+ false ,
1308
1295
self . resolve_vars_if_possible ( normalized_term) ,
1309
1296
data. term ,
1310
1297
) ) ,
@@ -1444,12 +1431,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
1444
1431
& mut diag,
1445
1432
& obligation. cause ,
1446
1433
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) )
1453
1436
} ) ,
1454
1437
err,
1455
1438
true ,
0 commit comments