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