@@ -1375,15 +1375,22 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
13751375 ( xform_self_ty, xform_ret_ty) =
13761376 self . xform_self_ty ( probe. item , impl_ty, impl_args) ;
13771377 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+ }
13821387 Err ( err) => {
13831388 debug ! ( "--> cannot relate self-types {:?}" , err) ;
13841389 return ProbeResult :: NoMatch ;
13851390 }
13861391 }
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) ;
13871394 // Check whether the impl imposes obligations we have to worry about.
13881395 let impl_def_id = probe. item . container_id ( self . tcx ) ;
13891396 let impl_bounds =
@@ -1425,11 +1432,19 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14251432 infer:: FnCall ,
14261433 poly_trait_ref,
14271434 ) ;
1435+ let trait_ref = ocx. normalize ( cause, self . param_env , trait_ref) ;
14281436 ( xform_self_ty, xform_ret_ty) =
14291437 self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
14301438 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+ }
14331448 Err ( err) => {
14341449 debug ! ( "--> cannot relate self-types {:?}" , err) ;
14351450 return ProbeResult :: NoMatch ;
@@ -1452,8 +1467,15 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14521467 ( xform_self_ty, xform_ret_ty) =
14531468 self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
14541469 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+ }
14571479 Err ( err) => {
14581480 debug ! ( "--> cannot relate self-types {:?}" , err) ;
14591481 return ProbeResult :: NoMatch ;
0 commit comments