Skip to content

Commit 3352775

Browse files
committed
Inline and remove renumber_regions.
It has a single callsite.
1 parent 88fb1b9 commit 3352775

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

compiler/rustc_borrowck/src/renumber.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,6 @@ pub fn renumber_mir<'tcx>(
2929
visitor.visit_body(body);
3030
}
3131

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-
5032
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
5133
pub(crate) enum BoundRegionInfo {
5234
Name(Symbol),
@@ -87,12 +69,17 @@ struct NllVisitor<'a, 'tcx> {
8769
}
8870

8971
impl<'a, 'tcx> NllVisitor<'a, 'tcx> {
72+
/// Replaces all regions appearing in `value` with fresh inference
73+
/// variables.
9074
fn renumber_regions<T, F>(&mut self, value: T, region_ctxt_fn: F) -> T
9175
where
9276
T: TypeFoldable<TyCtxt<'tcx>>,
9377
F: Fn() -> RegionCtxt,
9478
{
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+
})
9683
}
9784
}
9885

0 commit comments

Comments
 (0)