@@ -1374,15 +1374,22 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1374
1374
( xform_self_ty, xform_ret_ty) =
1375
1375
self . xform_self_ty ( probe. item , impl_ty, impl_args) ;
1376
1376
xform_self_ty = ocx. normalize ( cause, self . param_env , xform_self_ty) ;
1377
- // FIXME: Weirdly, we normalize the ret ty in this candidate, but no other candidates.
1378
- xform_ret_ty = ocx. normalize ( cause, self . param_env , xform_ret_ty) ;
1379
- match ocx. eq_no_opaques ( cause, self . param_env , xform_self_ty, self_ty) {
1380
- Ok ( ( ) ) => { }
1377
+ // FIXME: Make this `ocx.eq` once we define opaques more eagerly.
1378
+ match self . at ( cause, self . param_env ) . eq (
1379
+ DefineOpaqueTypes :: No ,
1380
+ xform_self_ty,
1381
+ self_ty,
1382
+ ) {
1383
+ Ok ( infer_ok) => {
1384
+ ocx. register_infer_ok_obligations ( infer_ok) ;
1385
+ }
1381
1386
Err ( err) => {
1382
1387
debug ! ( "--> cannot relate self-types {:?}" , err) ;
1383
1388
return ProbeResult :: NoMatch ;
1384
1389
}
1385
1390
}
1391
+ // FIXME: Weirdly, we normalize the ret ty in this candidate, but no other candidates.
1392
+ xform_ret_ty = ocx. normalize ( cause, self . param_env , xform_ret_ty) ;
1386
1393
// Check whether the impl imposes obligations we have to worry about.
1387
1394
let impl_def_id = probe. item . container_id ( self . tcx ) ;
1388
1395
let impl_bounds =
@@ -1424,11 +1431,19 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1424
1431
infer:: FnCall ,
1425
1432
poly_trait_ref,
1426
1433
) ;
1434
+ let trait_ref = ocx. normalize ( cause, self . param_env , trait_ref) ;
1427
1435
( xform_self_ty, xform_ret_ty) =
1428
1436
self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
1429
1437
xform_self_ty = ocx. normalize ( cause, self . param_env , xform_self_ty) ;
1430
- match ocx. eq_no_opaques ( cause, self . param_env , xform_self_ty, self_ty) {
1431
- Ok ( ( ) ) => { }
1438
+ // FIXME: Make this `ocx.eq` once we define opaques more eagerly.
1439
+ match self . at ( cause, self . param_env ) . eq (
1440
+ DefineOpaqueTypes :: No ,
1441
+ xform_self_ty,
1442
+ self_ty,
1443
+ ) {
1444
+ Ok ( infer_ok) => {
1445
+ ocx. register_infer_ok_obligations ( infer_ok) ;
1446
+ }
1432
1447
Err ( err) => {
1433
1448
debug ! ( "--> cannot relate self-types {:?}" , err) ;
1434
1449
return ProbeResult :: NoMatch ;
@@ -1451,8 +1466,15 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1451
1466
( xform_self_ty, xform_ret_ty) =
1452
1467
self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
1453
1468
xform_self_ty = ocx. normalize ( cause, self . param_env , xform_self_ty) ;
1454
- match ocx. eq_no_opaques ( cause, self . param_env , xform_self_ty, self_ty) {
1455
- Ok ( ( ) ) => { }
1469
+ // FIXME: Make this `ocx.eq` once we define opaques more eagerly.
1470
+ match self . at ( cause, self . param_env ) . eq (
1471
+ DefineOpaqueTypes :: No ,
1472
+ xform_self_ty,
1473
+ self_ty,
1474
+ ) {
1475
+ Ok ( infer_ok) => {
1476
+ ocx. register_infer_ok_obligations ( infer_ok) ;
1477
+ }
1456
1478
Err ( err) => {
1457
1479
debug ! ( "--> cannot relate self-types {:?}" , err) ;
1458
1480
return ProbeResult :: NoMatch ;
0 commit comments