Skip to content

Commit 7fd9bee

Browse files
committed
Rename to match similar methods
1 parent fef872a commit 7fd9bee

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

compiler/rustc_hir_typeck/src/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
542542
ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred)) => {
543543
assert_eq!(trait_pred.trait_ref.self_ty(), opaque_ty);
544544
ty::PredicateKind::Clause(ty::Clause::Trait(
545-
trait_pred.with_self_type(self.tcx, ty),
545+
trait_pred.with_self_ty(self.tcx, ty),
546546
))
547547
}
548548
ty::PredicateKind::Clause(ty::Clause::Projection(mut proj_pred)) => {

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,8 @@ impl<'tcx> TraitPredicate<'tcx> {
781781
}
782782
}
783783

784-
pub fn with_self_type(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
785-
Self { trait_ref: self.trait_ref.with_self_type(tcx, self_ty), ..self }
784+
pub fn with_self_ty(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
785+
Self { trait_ref: self.trait_ref.with_self_ty(tcx, self_ty), ..self }
786786
}
787787

788788
pub fn def_id(self) -> DefId {

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ impl<'tcx> TraitRef<'tcx> {
823823
TraitRef { def_id, substs }
824824
}
825825

826-
pub fn with_self_type(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
826+
pub fn with_self_ty(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
827827
tcx.mk_trait_ref(
828828
self.def_id,
829829
[self_ty.into()].into_iter().chain(self.substs.iter().skip(1)),

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
10361036
&& self.fallback_has_occurred
10371037
{
10381038
let predicate = trait_predicate.map_bound(|trait_pred| {
1039-
trait_pred.with_self_type(self.tcx, self.tcx.mk_unit())
1039+
trait_pred.with_self_ty(self.tcx, self.tcx.mk_unit())
10401040
});
10411041
let unit_obligation = obligation.with(tcx, predicate);
10421042
if self.predicate_may_hold(&unit_obligation) {
@@ -2085,8 +2085,8 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
20852085
param_env: ty::ParamEnv<'tcx>,
20862086
trait_ref_and_ty: ty::Binder<'tcx, (ty::TraitPredicate<'tcx>, Ty<'tcx>)>,
20872087
) -> PredicateObligation<'tcx> {
2088-
let trait_pred = trait_ref_and_ty
2089-
.map_bound(|(tr, new_self_ty)| tr.with_self_type(self.tcx, new_self_ty));
2088+
let trait_pred =
2089+
trait_ref_and_ty.map_bound(|(tr, new_self_ty)| tr.with_self_ty(self.tcx, new_self_ty));
20902090

20912091
Obligation::new(self.tcx, ObligationCause::dummy(), param_env, trait_pred)
20922092
}

compiler/rustc_trait_selection/src/traits/relationships.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) fn update<'tcx, T>(
2626
.kind()
2727
.rebind(
2828
// (*) binder moved here
29-
ty::PredicateKind::Clause(ty::Clause::Trait(tpred.with_self_type(infcx.tcx, new_self_ty)))
29+
ty::PredicateKind::Clause(ty::Clause::Trait(tpred.with_self_ty(infcx.tcx, new_self_ty)))
3030
),
3131
);
3232
// Don't report overflow errors. Otherwise equivalent to may_hold.

0 commit comments

Comments
 (0)