@@ -465,13 +465,12 @@ impl<'tcx> TyCtxt<'tcx> {
465465 pub fn fold_regions < T > (
466466 self ,
467467 value : T ,
468- skipped_regions : & mut bool ,
469468 mut f : impl FnMut ( ty:: Region < ' tcx > , ty:: DebruijnIndex ) -> ty:: Region < ' tcx > ,
470469 ) -> T
471470 where
472471 T : TypeFoldable < ' tcx > ,
473472 {
474- value. fold_with ( & mut RegionFolder :: new ( self , skipped_regions , & mut f) )
473+ value. fold_with ( & mut RegionFolder :: new ( self , & mut f) )
475474 }
476475
477476 /// Invoke `callback` on every region appearing free in `value`.
@@ -579,7 +578,6 @@ impl<'tcx> TyCtxt<'tcx> {
579578
580579pub struct RegionFolder < ' a , ' tcx > {
581580 tcx : TyCtxt < ' tcx > ,
582- skipped_regions : & ' a mut bool ,
583581
584582 /// Stores the index of a binder *just outside* the stuff we have
585583 /// visited. So this begins as INNERMOST; when we pass through a
@@ -597,10 +595,9 @@ impl<'a, 'tcx> RegionFolder<'a, 'tcx> {
597595 #[ inline]
598596 pub fn new (
599597 tcx : TyCtxt < ' tcx > ,
600- skipped_regions : & ' a mut bool ,
601598 fold_region_fn : & ' a mut dyn FnMut ( ty:: Region < ' tcx > , ty:: DebruijnIndex ) -> ty:: Region < ' tcx > ,
602599 ) -> RegionFolder < ' a , ' tcx > {
603- RegionFolder { tcx, skipped_regions , current_index : ty:: INNERMOST , fold_region_fn }
600+ RegionFolder { tcx, current_index : ty:: INNERMOST , fold_region_fn }
604601 }
605602}
606603
@@ -624,7 +621,6 @@ impl<'a, 'tcx> TypeFolder<'tcx> for RegionFolder<'a, 'tcx> {
624621 match * r {
625622 ty:: ReLateBound ( debruijn, _) if debruijn < self . current_index => {
626623 debug ! ( ?self . current_index, "skipped bound region" ) ;
627- * self . skipped_regions = true ;
628624 r
629625 }
630626 _ => {
0 commit comments