Skip to content

Commit a52c918

Browse files
committed
w
1 parent 2e850cc commit a52c918

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

compiler/rustc_borrowck/src/universal_regions.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,9 @@ impl<'tcx> BorrowckInferCtxt<'tcx> {
843843
{
844844
let (value, _map) = self.tcx.instantiate_bound_regions(value, |br| {
845845
debug!(?br);
846+
let kind = ty::LateParamRegionKind::from_bound(br.var, br.kind);
846847
let liberated_region =
847-
ty::Region::new_late_param_from_bound(self.tcx, all_outlive_scope.to_def_id(), br);
848+
ty::Region::new_late_param(self.tcx, all_outlive_scope.to_def_id(), kind);
848849
let region_vid = {
849850
let name = match br.kind.get_name() {
850851
Some(name) => name,

compiler/rustc_middle/src/ty/fold.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ impl<'tcx> TyCtxt<'tcx> {
270270
T: TypeFoldable<TyCtxt<'tcx>>,
271271
{
272272
self.instantiate_bound_regions_uncached(value, |br| {
273-
ty::Region::new_late_param_from_bound(self, all_outlive_scope, br)
273+
let kind = ty::LateParamRegionKind::from_bound(br.var, br.kind);
274+
ty::Region::new_late_param(self, all_outlive_scope, kind)
274275
})
275276
}
276277

compiler/rustc_middle/src/ty/region.rs

-11
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ impl<'tcx> Region<'tcx> {
7676
tcx.intern_region(ty::ReLateParam(data))
7777
}
7878

79-
#[inline]
80-
pub fn new_late_param_from_bound(
81-
tcx: TyCtxt<'tcx>,
82-
scope: DefId,
83-
bound: BoundRegion,
84-
) -> Region<'tcx> {
85-
let data =
86-
LateParamRegion { scope, kind: LateParamRegionKind::from_bound(bound.var, bound.kind) };
87-
tcx.intern_region(ty::ReLateParam(data))
88-
}
89-
9079
#[inline]
9180
pub fn new_var(tcx: TyCtxt<'tcx>, v: ty::RegionVid) -> Region<'tcx> {
9281
// Use a pre-interned one when possible.

0 commit comments

Comments
 (0)