@@ -1374,15 +1374,22 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
13741374 ( xform_self_ty, xform_ret_ty) =
13751375 self . xform_self_ty ( probe. item , impl_ty, impl_args) ;
13761376 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+ }
13811386 Err ( err) => {
13821387 debug ! ( "--> cannot relate self-types {:?}" , err) ;
13831388 return ProbeResult :: NoMatch ;
13841389 }
13851390 }
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) ;
13861393 // Check whether the impl imposes obligations we have to worry about.
13871394 let impl_def_id = probe. item . container_id ( self . tcx ) ;
13881395 let impl_bounds =
@@ -1424,11 +1431,19 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14241431 infer:: FnCall ,
14251432 poly_trait_ref,
14261433 ) ;
1434+ let trait_ref = ocx. normalize ( cause, self . param_env , trait_ref) ;
14271435 ( xform_self_ty, xform_ret_ty) =
14281436 self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
14291437 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+ }
14321447 Err ( err) => {
14331448 debug ! ( "--> cannot relate self-types {:?}" , err) ;
14341449 return ProbeResult :: NoMatch ;
@@ -1451,8 +1466,15 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14511466 ( xform_self_ty, xform_ret_ty) =
14521467 self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
14531468 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+ }
14561478 Err ( err) => {
14571479 debug ! ( "--> cannot relate self-types {:?}" , err) ;
14581480 return ProbeResult :: NoMatch ;
0 commit comments