Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5d6bebd

Browse files
authored
Rollup merge of rust-lang#126650 - compiler-errors:renames, r=lcnr
Rename a bunch of things in the new solver and `rustc_type_ir` * Renames `interner()` to `cx()` in the solver and `TypeFolder`. * Renames `Infcx` generic param to `D` * Moves `infcx.rs` to `delegate.rs` r? lcnr
2 parents 2dab8c3 + ec88615 commit 5d6bebd

File tree

60 files changed

+536
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+536
-565
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
11101110
tcx: TyCtxt<'tcx>,
11111111
}
11121112
impl<'tcx> ty::TypeFolder<TyCtxt<'tcx>> for OpaqueFolder<'tcx> {
1113-
fn interner(&self) -> TyCtxt<'tcx> {
1113+
fn cx(&self) -> TyCtxt<'tcx> {
11141114
self.tcx
11151115
}
11161116
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ struct RemapLateBound<'a, 'tcx> {
397397
}
398398

399399
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
400-
fn interner(&self) -> TyCtxt<'tcx> {
400+
fn cx(&self) -> TyCtxt<'tcx> {
401401
self.tcx
402402
}
403403

@@ -790,13 +790,13 @@ impl<'tcx, E> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx, E
790790
where
791791
E: 'tcx,
792792
{
793-
fn interner(&self) -> TyCtxt<'tcx> {
793+
fn cx(&self) -> TyCtxt<'tcx> {
794794
self.ocx.infcx.tcx
795795
}
796796

797797
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
798798
if let ty::Alias(ty::Projection, proj) = ty.kind()
799-
&& self.interner().is_impl_trait_in_trait(proj.def_id)
799+
&& self.cx().is_impl_trait_in_trait(proj.def_id)
800800
{
801801
if let Some((ty, _)) = self.types.get(&proj.def_id) {
802802
return *ty;
@@ -810,9 +810,9 @@ where
810810
self.types.insert(proj.def_id, (infer_ty, proj.args));
811811
// Recurse into bounds
812812
for (pred, pred_span) in self
813-
.interner()
813+
.cx()
814814
.explicit_item_bounds(proj.def_id)
815-
.iter_instantiated_copied(self.interner(), proj.args)
815+
.iter_instantiated_copied(self.cx(), proj.args)
816816
{
817817
let pred = pred.fold_with(self);
818818
let pred = self.ocx.normalize(
@@ -822,7 +822,7 @@ where
822822
);
823823

824824
self.ocx.register_obligation(traits::Obligation::new(
825-
self.interner(),
825+
self.cx(),
826826
ObligationCause::new(
827827
self.span,
828828
self.body_id,
@@ -853,7 +853,7 @@ struct RemapHiddenTyRegions<'tcx> {
853853
impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
854854
type Error = ErrorGuaranteed;
855855

856-
fn interner(&self) -> TyCtxt<'tcx> {
856+
fn cx(&self) -> TyCtxt<'tcx> {
857857
self.tcx
858858
}
859859

@@ -2072,7 +2072,7 @@ struct ReplaceTy<'tcx> {
20722072
}
20732073

20742074
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReplaceTy<'tcx> {
2075-
fn interner(&self) -> TyCtxt<'tcx> {
2075+
fn cx(&self) -> TyCtxt<'tcx> {
20762076
self.tcx
20772077
}
20782078

compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ struct Anonymize<'tcx> {
322322
}
323323

324324
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Anonymize<'tcx> {
325-
fn interner(&self) -> TyCtxt<'tcx> {
325+
fn cx(&self) -> TyCtxt<'tcx> {
326326
self.tcx
327327
}
328328

compiler/rustc_hir_analysis/src/coherence/orphan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ struct TyVarReplacer<'cx, 'tcx> {
539539
}
540540

541541
impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for TyVarReplacer<'cx, 'tcx> {
542-
fn interner(&self) -> TyCtxt<'tcx> {
542+
fn cx(&self) -> TyCtxt<'tcx> {
543543
self.infcx.tcx
544544
}
545545

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ struct AssocTyToOpaque<'tcx> {
203203
}
204204

205205
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTyToOpaque<'tcx> {
206-
fn interner(&self) -> TyCtxt<'tcx> {
206+
fn cx(&self) -> TyCtxt<'tcx> {
207207
self.tcx
208208
}
209209

compiler/rustc_hir_typeck/src/writeback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> {
847847
}
848848

849849
impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Resolver<'cx, 'tcx> {
850-
fn interner(&self) -> TyCtxt<'tcx> {
850+
fn cx(&self) -> TyCtxt<'tcx> {
851851
self.fcx.tcx
852852
}
853853

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ struct Canonicalizer<'cx, 'tcx> {
304304
}
305305

306306
impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
307-
fn interner(&self) -> TyCtxt<'tcx> {
307+
fn cx(&self) -> TyCtxt<'tcx> {
308308
self.tcx
309309
}
310310

@@ -773,7 +773,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
773773
) -> ty::Region<'tcx> {
774774
let var = self.canonical_var(info, r.into());
775775
let br = ty::BoundRegion { var, kind: ty::BrAnon };
776-
ty::Region::new_bound(self.interner(), self.binder_index, br)
776+
ty::Region::new_bound(self.cx(), self.binder_index, br)
777777
}
778778

779779
/// Given a type variable `ty_var` of the given kind, first check

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct ClosureEraser<'tcx> {
158158
}
159159

160160
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ClosureEraser<'tcx> {
161-
fn interner(&self) -> TyCtxt<'tcx> {
161+
fn cx(&self) -> TyCtxt<'tcx> {
162162
self.tcx
163163
}
164164

compiler/rustc_infer/src/infer/freshen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<'a, 'tcx> TypeFreshener<'a, 'tcx> {
100100
}
101101

102102
impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for TypeFreshener<'a, 'tcx> {
103-
fn interner(&self) -> TyCtxt<'tcx> {
103+
fn cx(&self) -> TyCtxt<'tcx> {
104104
self.infcx.tcx
105105
}
106106

@@ -117,7 +117,7 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for TypeFreshener<'a, 'tcx> {
117117
| ty::RePlaceholder(..)
118118
| ty::ReStatic
119119
| ty::ReError(_)
120-
| ty::ReErased => self.interner().lifetimes.re_erased,
120+
| ty::ReErased => self.cx().lifetimes.re_erased,
121121
}
122122
}
123123

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ struct InferenceLiteralEraser<'tcx> {
17191719
}
17201720

17211721
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for InferenceLiteralEraser<'tcx> {
1722-
fn interner(&self) -> TyCtxt<'tcx> {
1722+
fn cx(&self) -> TyCtxt<'tcx> {
17231723
self.tcx
17241724
}
17251725

@@ -1859,7 +1859,7 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>(
18591859
}
18601860

18611861
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReplaceParamAndInferWithPlaceholder<'tcx> {
1862-
fn interner(&self) -> TyCtxt<'tcx> {
1862+
fn cx(&self) -> TyCtxt<'tcx> {
18631863
self.tcx
18641864
}
18651865

0 commit comments

Comments
 (0)