Skip to content

Commit 2f9794b

Browse files
remove _types from ocx method names
1 parent ce11ae5 commit 2f9794b

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

Diff for: compiler/rustc_hir_analysis/src/check/compare_method.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,16 @@ fn compare_predicate_entailment<'tcx>(
290290
// type would be more appropriate. In other places we have a `Vec<Span>`
291291
// corresponding to their `Vec<Predicate>`, but we don't have that here.
292292
// Fixing this would improve the output of test `issue-83765.rs`.
293-
let mut result = ocx.sup_types(&cause, param_env, trait_fty, impl_fty);
293+
let mut result = ocx.sup(&cause, param_env, trait_fty, impl_fty);
294294

295295
// HACK(RPITIT): #101614. When we are trying to infer the hidden types for
296296
// RPITITs, we need to equate the output tys instead of just subtyping. If
297297
// we just use `sup` above, we'll end up `&'static str <: _#1t`, which causes
298298
// us to infer `_#1t = #'_#2r str`, where `'_#2r` is unconstrained, which gets
299299
// fixed up to `ReEmpty`, and which is certainly not what we want.
300300
if trait_fty.has_infer_types() {
301-
result = result.and_then(|()| {
302-
ocx.equate_types(&cause, param_env, trait_sig.output(), impl_sig.output())
303-
});
301+
result =
302+
result.and_then(|()| ocx.eq(&cause, param_env, trait_sig.output(), impl_sig.output()));
304303
}
305304

306305
if let Err(terr) = result {
@@ -1383,7 +1382,7 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
13831382

13841383
debug!("compare_const_impl: trait_ty={:?}", trait_ty);
13851384

1386-
let err = ocx.sup_types(&cause, param_env, trait_ty, impl_ty);
1385+
let err = ocx.sup(&cause, param_env, trait_ty, impl_ty);
13871386

13881387
if let Err(terr) = err {
13891388
debug!(

Diff for: compiler/rustc_hir_analysis/src/check/wfcheck.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ fn receiver_is_valid<'tcx>(
16751675

16761676
// `self: Self` is always valid.
16771677
if can_eq_self(receiver_ty) {
1678-
if let Err(err) = wfcx.equate_types(&cause, wfcx.param_env, self_ty, receiver_ty) {
1678+
if let Err(err) = wfcx.eq(&cause, wfcx.param_env, self_ty, receiver_ty) {
16791679
infcx.err_ctxt().report_mismatched_types(&cause, self_ty, receiver_ty, err).emit();
16801680
}
16811681
return true;
@@ -1705,9 +1705,7 @@ fn receiver_is_valid<'tcx>(
17051705
if can_eq_self(potential_self_ty) {
17061706
wfcx.register_obligations(autoderef.into_obligations());
17071707

1708-
if let Err(err) =
1709-
wfcx.equate_types(&cause, wfcx.param_env, self_ty, potential_self_ty)
1710-
{
1708+
if let Err(err) = wfcx.eq(&cause, wfcx.param_env, self_ty, potential_self_ty) {
17111709
infcx
17121710
.err_ctxt()
17131711
.report_mismatched_types(&cause, self_ty, potential_self_ty, err)

Diff for: compiler/rustc_trait_selection/src/traits/engine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> {
112112
self.register_infer_ok_obligations(infer_ok)
113113
}
114114

115-
pub fn equate_types<T: ToTrace<'tcx>>(
115+
pub fn eq<T: ToTrace<'tcx>>(
116116
&self,
117117
cause: &ObligationCause<'tcx>,
118118
param_env: ty::ParamEnv<'tcx>,
@@ -128,7 +128,7 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> {
128128
}
129129
}
130130

131-
pub fn sup_types<T: ToTrace<'tcx>>(
131+
pub fn sup<T: ToTrace<'tcx>>(
132132
&self,
133133
cause: &ObligationCause<'tcx>,
134134
param_env: ty::ParamEnv<'tcx>,

Diff for: compiler/rustc_traits/src/type_op.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
8787
where
8888
T: ToTrace<'tcx>,
8989
{
90-
Ok(self.ocx.equate_types(&ObligationCause::dummy_with_span(self.span), self.param_env, a, b)?)
90+
Ok(self.ocx.eq(&ObligationCause::dummy_with_span(self.span), self.param_env, a, b)?)
9191
}
9292

9393
fn prove_predicate(&self, predicate: Predicate<'tcx>, cause: ObligationCause<'tcx>) {
@@ -176,7 +176,7 @@ fn type_op_eq<'tcx>(
176176
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
177177
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| {
178178
let (param_env, Eq { a, b }) = key.into_parts();
179-
Ok(ocx.equate_types(&ObligationCause::dummy(), param_env, a, b)?)
179+
Ok(ocx.eq(&ObligationCause::dummy(), param_env, a, b)?)
180180
})
181181
}
182182

@@ -228,7 +228,7 @@ fn type_op_subtype<'tcx>(
228228
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
229229
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| {
230230
let (param_env, Subtype { sub, sup }) = key.into_parts();
231-
Ok(ocx.sup_types(&ObligationCause::dummy(), param_env, sup, sub)?)
231+
Ok(ocx.sup(&ObligationCause::dummy(), param_env, sup, sub)?)
232232
})
233233
}
234234

0 commit comments

Comments
 (0)