1
Fork 0

Rename folder traits' tcx method to interner

This commit is contained in:
Alan Egerton 2023-02-11 09:18:12 +00:00
parent 459e142413
commit 63ad5d0522
No known key found for this signature in database
GPG key ID: 7D4C2F6C22122532
33 changed files with 91 additions and 87 deletions

View file

@ -449,7 +449,7 @@ impl<'a, 'b, 'tcx> AssocTypeNormalizer<'a, 'b, 'tcx> {
}
impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx> {
fn tcx<'c>(&'c self) -> TyCtxt<'tcx> {
fn interner(&self) -> TyCtxt<'tcx> {
self.selcx.tcx()
}
@ -503,7 +503,7 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
Reveal::UserFacing => ty.super_fold_with(self),
Reveal::All => {
let recursion_limit = self.tcx().recursion_limit();
let recursion_limit = self.interner().recursion_limit();
if !recursion_limit.value_within_limit(self.depth) {
self.selcx.infcx.err_ctxt().report_overflow_error(
&ty,
@ -514,8 +514,8 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
}
let substs = substs.fold_with(self);
let generic_ty = self.tcx().bound_type_of(def_id);
let concrete_ty = generic_ty.subst(self.tcx(), substs);
let generic_ty = self.interner().bound_type_of(def_id);
let concrete_ty = generic_ty.subst(self.interner(), substs);
self.depth += 1;
let folded_ty = self.fold_ty(concrete_ty);
self.depth -= 1;
@ -741,7 +741,7 @@ impl<'me, 'tcx> BoundVarReplacer<'me, 'tcx> {
}
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for BoundVarReplacer<'_, 'tcx> {
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
fn interner(&self) -> TyCtxt<'tcx> {
self.infcx.tcx
}
@ -847,7 +847,7 @@ impl<'me, 'tcx> PlaceholderReplacer<'me, 'tcx> {
}
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
fn interner(&self) -> TyCtxt<'tcx> {
self.infcx.tcx
}
@ -888,7 +888,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
let db = ty::DebruijnIndex::from_usize(
self.universe_indices.len() - index + self.current_index.as_usize() - 1,
);
self.tcx().mk_region(ty::ReLateBound(db, *replace_var))
self.interner().mk_region(ty::ReLateBound(db, *replace_var))
}
None => r1,
}
@ -915,7 +915,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
let db = ty::DebruijnIndex::from_usize(
self.universe_indices.len() - index + self.current_index.as_usize() - 1,
);
self.tcx().mk_bound(db, *replace_var)
self.interner().mk_bound(db, *replace_var)
}
None => ty,
}
@ -939,7 +939,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
let db = ty::DebruijnIndex::from_usize(
self.universe_indices.len() - index + self.current_index.as_usize() - 1,
);
self.tcx().mk_const(ty::ConstKind::Bound(db, *replace_var), ct.ty())
self.interner().mk_const(ty::ConstKind::Bound(db, *replace_var), ct.ty())
}
None => ct,
}