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

Commit 9783fcc

Browse files
committed
Make folding traits generic over the Interner
1 parent dea342d commit 9783fcc

File tree

39 files changed

+160
-130
lines changed

39 files changed

+160
-130
lines changed

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ struct RemapLateBound<'a, 'tcx> {
464464
mapping: &'a FxHashMap<ty::BoundRegionKind, ty::BoundRegionKind>,
465465
}
466466

467-
impl<'tcx> TypeFolder<'tcx> for RemapLateBound<'_, 'tcx> {
467+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
468468
fn tcx(&self) -> TyCtxt<'tcx> {
469469
self.tcx
470470
}
@@ -829,7 +829,7 @@ impl<'a, 'tcx> ImplTraitInTraitCollector<'a, 'tcx> {
829829
}
830830
}
831831

832-
impl<'tcx> TypeFolder<'tcx> for ImplTraitInTraitCollector<'_, 'tcx> {
832+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
833833
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
834834
self.ocx.infcx.tcx
835835
}

compiler/rustc_hir_analysis/src/collect/type_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ fn infer_placeholder_type<'a>(
850850
tcx: TyCtxt<'tcx>,
851851
}
852852

853-
impl<'tcx> TypeFolder<'tcx> for MakeNameable<'tcx> {
853+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for MakeNameable<'tcx> {
854854
fn tcx(&self) -> TyCtxt<'tcx> {
855855
self.tcx
856856
}

compiler/rustc_hir_analysis/src/hir_wf_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct EraseAllBoundRegions<'tcx> {
189189
// us an inaccurate span for an error message, but cannot
190190
// lead to unsoundness (we call `delay_span_bug` at the start
191191
// of `diagnostic_hir_wf_check`).
192-
impl<'tcx> TypeFolder<'tcx> for EraseAllBoundRegions<'tcx> {
192+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for EraseAllBoundRegions<'tcx> {
193193
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
194194
self.tcx
195195
}

compiler/rustc_hir_typeck/src/op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ fn is_builtin_binop<'tcx>(lhs: Ty<'tcx>, rhs: Ty<'tcx>, op: hir::BinOp) -> bool
963963

964964
struct TypeParamEraser<'a, 'tcx>(&'a FnCtxt<'a, 'tcx>, Span);
965965

966-
impl<'tcx> TypeFolder<'tcx> for TypeParamEraser<'_, 'tcx> {
966+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for TypeParamEraser<'_, 'tcx> {
967967
fn tcx(&self) -> TyCtxt<'tcx> {
968968
self.0.tcx
969969
}

compiler/rustc_hir_typeck/src/writeback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ struct EraseEarlyRegions<'tcx> {
763763
tcx: TyCtxt<'tcx>,
764764
}
765765

766-
impl<'tcx> TypeFolder<'tcx> for EraseEarlyRegions<'tcx> {
766+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for EraseEarlyRegions<'tcx> {
767767
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
768768
self.tcx
769769
}
@@ -779,7 +779,7 @@ impl<'tcx> TypeFolder<'tcx> for EraseEarlyRegions<'tcx> {
779779
}
780780
}
781781

782-
impl<'cx, 'tcx> TypeFolder<'tcx> for Resolver<'cx, 'tcx> {
782+
impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Resolver<'cx, 'tcx> {
783783
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
784784
self.tcx
785785
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ struct Canonicalizer<'cx, 'tcx> {
326326
binder_index: ty::DebruijnIndex,
327327
}
328328

329-
impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
329+
impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
330330
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
331331
self.tcx
332332
}

compiler/rustc_infer/src/infer/combine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ struct ConstInferUnifier<'cx, 'tcx> {
844844
target_vid: ty::ConstVid<'tcx>,
845845
}
846846

847-
impl<'tcx> FallibleTypeFolder<'tcx> for ConstInferUnifier<'_, 'tcx> {
847+
impl<'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for ConstInferUnifier<'_, 'tcx> {
848848
type Error = TypeError<'tcx>;
849849

850850
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {

compiler/rustc_infer/src/infer/freshen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'a, 'tcx> TypeFreshener<'a, 'tcx> {
105105
}
106106
}
107107

108-
impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
108+
impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for TypeFreshener<'a, 'tcx> {
109109
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
110110
self.infcx.tcx
111111
}

compiler/rustc_infer/src/infer/fudge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub struct InferenceFudger<'a, 'tcx> {
175175
const_vars: (Range<ConstVid<'tcx>>, Vec<ConstVariableOrigin>),
176176
}
177177

178-
impl<'a, 'tcx> TypeFolder<'tcx> for InferenceFudger<'a, 'tcx> {
178+
impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for InferenceFudger<'a, 'tcx> {
179179
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
180180
self.infcx.tcx
181181
}

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ struct InferenceLiteralEraser<'tcx> {
18521852
tcx: TyCtxt<'tcx>,
18531853
}
18541854

1855-
impl<'tcx> TypeFolder<'tcx> for InferenceLiteralEraser<'tcx> {
1855+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for InferenceLiteralEraser<'tcx> {
18561856
fn tcx(&self) -> TyCtxt<'tcx> {
18571857
self.tcx
18581858
}
@@ -1870,7 +1870,7 @@ struct ShallowResolver<'a, 'tcx> {
18701870
infcx: &'a InferCtxt<'tcx>,
18711871
}
18721872

1873-
impl<'a, 'tcx> TypeFolder<'tcx> for ShallowResolver<'a, 'tcx> {
1873+
impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for ShallowResolver<'a, 'tcx> {
18741874
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
18751875
self.infcx.tcx
18761876
}
@@ -2064,7 +2064,7 @@ fn replace_param_and_infer_substs_with_placeholder<'tcx>(
20642064
idx: u32,
20652065
}
20662066

2067-
impl<'tcx> TypeFolder<'tcx> for ReplaceParamAndInferWithPlaceholder<'tcx> {
2067+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReplaceParamAndInferWithPlaceholder<'tcx> {
20682068
fn tcx(&self) -> TyCtxt<'tcx> {
20692069
self.tcx
20702070
}

0 commit comments

Comments
 (0)