]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/fold.rs
fold_region: remove unused parameter
[rust.git] / compiler / rustc_middle / src / ty / fold.rs
index b1b8bc13e2f1320a1578e4a8e3001f9232efe309..a6310ae5e66bda9b4aea10c176709f150d053c53 100644 (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 @@ fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
 
 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 @@ fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
         match *r {
             ty::ReLateBound(debruijn, _) if debruijn < self.current_index => {
                 debug!(?self.current_index, "skipped bound region");
-                *self.skipped_regions = true;
                 r
             }
             _ => {