@@ -465,13 +465,12 @@ impl<'tcx> TyCtxt<'tcx> {
465
465
pub fn fold_regions < T > (
466
466
self ,
467
467
value : T ,
468
- skipped_regions : & mut bool ,
469
468
mut f : impl FnMut ( ty:: Region < ' tcx > , ty:: DebruijnIndex ) -> ty:: Region < ' tcx > ,
470
469
) -> T
471
470
where
472
471
T : TypeFoldable < ' tcx > ,
473
472
{
474
- value. fold_with ( & mut RegionFolder :: new ( self , skipped_regions , & mut f) )
473
+ value. fold_with ( & mut RegionFolder :: new ( self , & mut f) )
475
474
}
476
475
477
476
/// Invoke `callback` on every region appearing free in `value`.
@@ -579,7 +578,6 @@ impl<'tcx> TyCtxt<'tcx> {
579
578
580
579
pub struct RegionFolder < ' a , ' tcx > {
581
580
tcx : TyCtxt < ' tcx > ,
582
- skipped_regions : & ' a mut bool ,
583
581
584
582
/// Stores the index of a binder *just outside* the stuff we have
585
583
/// visited. So this begins as INNERMOST; when we pass through a
@@ -597,10 +595,9 @@ impl<'a, 'tcx> RegionFolder<'a, 'tcx> {
597
595
#[ inline]
598
596
pub fn new (
599
597
tcx : TyCtxt < ' tcx > ,
600
- skipped_regions : & ' a mut bool ,
601
598
fold_region_fn : & ' a mut dyn FnMut ( ty:: Region < ' tcx > , ty:: DebruijnIndex ) -> ty:: Region < ' tcx > ,
602
599
) -> 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 }
604
601
}
605
602
}
606
603
@@ -624,7 +621,6 @@ impl<'a, 'tcx> TypeFolder<'tcx> for RegionFolder<'a, 'tcx> {
624
621
match * r {
625
622
ty:: ReLateBound ( debruijn, _) if debruijn < self . current_index => {
626
623
debug ! ( ?self . current_index, "skipped bound region" ) ;
627
- * self . skipped_regions = true ;
628
624
r
629
625
}
630
626
_ => {
0 commit comments