diff --git a/compiler/rustc_hir_analysis/src/check/compare_method.rs b/compiler/rustc_hir_analysis/src/check/compare_method.rs index 616472a1a3f0d..1812f7a9efd96 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_method.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_method.rs @@ -290,7 +290,7 @@ fn compare_predicate_entailment<'tcx>( // type would be more appropriate. In other places we have a `Vec` // corresponding to their `Vec`, but we don't have that here. // Fixing this would improve the output of test `issue-83765.rs`. - let mut result = ocx.sup_types(&cause, param_env, trait_fty, impl_fty); + let mut result = ocx.sup(&cause, param_env, trait_fty, impl_fty); // HACK(RPITIT): #101614. When we are trying to infer the hidden types for // RPITITs, we need to equate the output tys instead of just subtyping. If @@ -298,9 +298,8 @@ fn compare_predicate_entailment<'tcx>( // us to infer `_#1t = #'_#2r str`, where `'_#2r` is unconstrained, which gets // fixed up to `ReEmpty`, and which is certainly not what we want. if trait_fty.has_infer_types() { - result = result.and_then(|()| { - ocx.equate_types(&cause, param_env, trait_sig.output(), impl_sig.output()) - }); + result = + result.and_then(|()| ocx.eq(&cause, param_env, trait_sig.output(), impl_sig.output())); } if let Err(terr) = result { @@ -1383,7 +1382,7 @@ pub(crate) fn raw_compare_const_impl<'tcx>( debug!("compare_const_impl: trait_ty={:?}", trait_ty); - let err = ocx.sup_types(&cause, param_env, trait_ty, impl_ty); + let err = ocx.sup(&cause, param_env, trait_ty, impl_ty); if let Err(terr) = err { debug!( diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 70a171c02b26b..9689a14553013 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -1675,7 +1675,7 @@ fn receiver_is_valid<'tcx>( // `self: Self` is always valid. if can_eq_self(receiver_ty) { - if let Err(err) = wfcx.equate_types(&cause, wfcx.param_env, self_ty, receiver_ty) { + if let Err(err) = wfcx.eq(&cause, wfcx.param_env, self_ty, receiver_ty) { infcx.err_ctxt().report_mismatched_types(&cause, self_ty, receiver_ty, err).emit(); } return true; @@ -1705,9 +1705,7 @@ fn receiver_is_valid<'tcx>( if can_eq_self(potential_self_ty) { wfcx.register_obligations(autoderef.into_obligations()); - if let Err(err) = - wfcx.equate_types(&cause, wfcx.param_env, self_ty, potential_self_ty) - { + if let Err(err) = wfcx.eq(&cause, wfcx.param_env, self_ty, potential_self_ty) { infcx .err_ctxt() .report_mismatched_types(&cause, self_ty, potential_self_ty, err) diff --git a/compiler/rustc_trait_selection/src/traits/engine.rs b/compiler/rustc_trait_selection/src/traits/engine.rs index c760ce1fed912..21516c93efb53 100644 --- a/compiler/rustc_trait_selection/src/traits/engine.rs +++ b/compiler/rustc_trait_selection/src/traits/engine.rs @@ -112,7 +112,7 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> { self.register_infer_ok_obligations(infer_ok) } - pub fn equate_types>( + pub fn eq>( &self, cause: &ObligationCause<'tcx>, param_env: ty::ParamEnv<'tcx>, @@ -128,7 +128,7 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> { } } - pub fn sup_types>( + pub fn sup>( &self, cause: &ObligationCause<'tcx>, param_env: ty::ParamEnv<'tcx>, diff --git a/compiler/rustc_traits/src/type_op.rs b/compiler/rustc_traits/src/type_op.rs index e0465121ad920..98cb3f21555ac 100644 --- a/compiler/rustc_traits/src/type_op.rs +++ b/compiler/rustc_traits/src/type_op.rs @@ -87,7 +87,7 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> { where T: ToTrace<'tcx>, { - Ok(self.ocx.equate_types(&ObligationCause::dummy_with_span(self.span), self.param_env, a, b)?) + Ok(self.ocx.eq(&ObligationCause::dummy_with_span(self.span), self.param_env, a, b)?) } fn prove_predicate(&self, predicate: Predicate<'tcx>, cause: ObligationCause<'tcx>) { @@ -176,7 +176,7 @@ fn type_op_eq<'tcx>( ) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> { tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| { let (param_env, Eq { a, b }) = key.into_parts(); - Ok(ocx.equate_types(&ObligationCause::dummy(), param_env, a, b)?) + Ok(ocx.eq(&ObligationCause::dummy(), param_env, a, b)?) }) } @@ -228,7 +228,7 @@ fn type_op_subtype<'tcx>( ) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> { tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| { let (param_env, Subtype { sub, sup }) = key.into_parts(); - Ok(ocx.sup_types(&ObligationCause::dummy(), param_env, sup, sub)?) + Ok(ocx.sup(&ObligationCause::dummy(), param_env, sup, sub)?) }) }