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