@@ -29,24 +29,6 @@ pub fn renumber_mir<'tcx>(
29
29
visitor. visit_body ( body) ;
30
30
}
31
31
32
- /// Replaces all regions appearing in `value` with fresh inference
33
- /// variables.
34
- #[ instrument( skip( infcx, get_ctxt_fn) , level = "debug" ) ]
35
- pub ( crate ) fn renumber_regions < ' tcx , T , F > (
36
- infcx : & BorrowckInferCtxt < ' _ , ' tcx > ,
37
- value : T ,
38
- get_ctxt_fn : F ,
39
- ) -> T
40
- where
41
- T : TypeFoldable < TyCtxt < ' tcx > > ,
42
- F : Fn ( ) -> RegionCtxt ,
43
- {
44
- infcx. tcx . fold_regions ( value, |_region, _depth| {
45
- let origin = NllRegionVariableOrigin :: Existential { from_forall : false } ;
46
- infcx. next_nll_region_var ( origin, || get_ctxt_fn ( ) )
47
- } )
48
- }
49
-
50
32
#[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash ) ]
51
33
pub ( crate ) enum BoundRegionInfo {
52
34
Name ( Symbol ) ,
@@ -87,12 +69,17 @@ struct NllVisitor<'a, 'tcx> {
87
69
}
88
70
89
71
impl < ' a , ' tcx > NllVisitor < ' a , ' tcx > {
72
+ /// Replaces all regions appearing in `value` with fresh inference
73
+ /// variables.
90
74
fn renumber_regions < T , F > ( & mut self , value : T , region_ctxt_fn : F ) -> T
91
75
where
92
76
T : TypeFoldable < TyCtxt < ' tcx > > ,
93
77
F : Fn ( ) -> RegionCtxt ,
94
78
{
95
- renumber_regions ( self . infcx , value, region_ctxt_fn)
79
+ let origin = NllRegionVariableOrigin :: Existential { from_forall : false } ;
80
+ self . infcx . tcx . fold_regions ( value, |_region, _depth| {
81
+ self . infcx . next_nll_region_var ( origin, || region_ctxt_fn ( ) )
82
+ } )
96
83
}
97
84
}
98
85
0 commit comments