fold_region: remove unused parameter

This commit is contained in:
lcnr
2022-06-27 15:55:03 +02:00
parent 4dbf9ba0ab
commit 70497d9d10
12 changed files with 18 additions and 24 deletions

View File

@@ -465,13 +465,12 @@ impl<'tcx> TyCtxt<'tcx> {
pub fn fold_regions<T>(
self,
value: T,
skipped_regions: &mut bool,
mut f: impl FnMut(ty::Region<'tcx>, ty::DebruijnIndex) -> ty::Region<'tcx>,
) -> T
where
T: TypeFoldable<'tcx>,
{
value.fold_with(&mut RegionFolder::new(self, skipped_regions, &mut f))
value.fold_with(&mut RegionFolder::new(self, &mut f))
}
/// Invoke `callback` on every region appearing free in `value`.
@@ -579,7 +578,6 @@ impl<'tcx> TyCtxt<'tcx> {
pub struct RegionFolder<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
skipped_regions: &'a mut bool,
/// Stores the index of a binder *just outside* the stuff we have
/// visited. So this begins as INNERMOST; when we pass through a
@@ -597,10 +595,9 @@ impl<'a, 'tcx> RegionFolder<'a, 'tcx> {
#[inline]
pub fn new(
tcx: TyCtxt<'tcx>,
skipped_regions: &'a mut bool,
fold_region_fn: &'a mut dyn FnMut(ty::Region<'tcx>, ty::DebruijnIndex) -> ty::Region<'tcx>,
) -> RegionFolder<'a, 'tcx> {
RegionFolder { tcx, skipped_regions, current_index: ty::INNERMOST, fold_region_fn }
RegionFolder { tcx, current_index: ty::INNERMOST, fold_region_fn }
}
}
@@ -624,7 +621,6 @@ impl<'a, 'tcx> TypeFolder<'tcx> for RegionFolder<'a, 'tcx> {
match *r {
ty::ReLateBound(debruijn, _) if debruijn < self.current_index => {
debug!(?self.current_index, "skipped bound region");
*self.skipped_regions = true;
r
}
_ => {