@@ -1370,15 +1370,22 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
13701370 ( xform_self_ty, xform_ret_ty) =
13711371 self . xform_self_ty ( probe. item , impl_ty, impl_args) ;
13721372 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+ }
13771382 Err ( err) => {
13781383 debug ! ( "--> cannot relate self-types {:?}" , err) ;
13791384 return ProbeResult :: NoMatch ;
13801385 }
13811386 }
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) ;
13821389 // Check whether the impl imposes obligations we have to worry about.
13831390 let impl_def_id = probe. item . container_id ( self . tcx ) ;
13841391 let impl_bounds =
@@ -1420,11 +1427,19 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14201427 infer:: FnCall ,
14211428 poly_trait_ref,
14221429 ) ;
1430+ let trait_ref = ocx. normalize ( cause, self . param_env , trait_ref) ;
14231431 ( xform_self_ty, xform_ret_ty) =
14241432 self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
14251433 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+ }
14281443 Err ( err) => {
14291444 debug ! ( "--> cannot relate self-types {:?}" , err) ;
14301445 return ProbeResult :: NoMatch ;
@@ -1447,8 +1462,15 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14471462 ( xform_self_ty, xform_ret_ty) =
14481463 self . xform_self_ty ( probe. item , trait_ref. self_ty ( ) , trait_ref. args ) ;
14491464 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+ }
14521474 Err ( err) => {
14531475 debug ! ( "--> cannot relate self-types {:?}" , err) ;
14541476 return ProbeResult :: NoMatch ;
0 commit comments