Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Dec 6, 2024
1 parent 2e850cc commit a52c918
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
3 changes: 2 additions & 1 deletion compiler/rustc_borrowck/src/universal_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,9 @@ impl<'tcx> BorrowckInferCtxt<'tcx> {
{
let (value, _map) = self.tcx.instantiate_bound_regions(value, |br| {
debug!(?br);
let kind = ty::LateParamRegionKind::from_bound(br.var, br.kind);
let liberated_region =
ty::Region::new_late_param_from_bound(self.tcx, all_outlive_scope.to_def_id(), br);
ty::Region::new_late_param(self.tcx, all_outlive_scope.to_def_id(), kind);
let region_vid = {
let name = match br.kind.get_name() {
Some(name) => name,
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ impl<'tcx> TyCtxt<'tcx> {
T: TypeFoldable<TyCtxt<'tcx>>,
{
self.instantiate_bound_regions_uncached(value, |br| {
ty::Region::new_late_param_from_bound(self, all_outlive_scope, br)
let kind = ty::LateParamRegionKind::from_bound(br.var, br.kind);
ty::Region::new_late_param(self, all_outlive_scope, kind)
})
}

Expand Down
11 changes: 0 additions & 11 deletions compiler/rustc_middle/src/ty/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,6 @@ impl<'tcx> Region<'tcx> {
tcx.intern_region(ty::ReLateParam(data))
}

#[inline]
pub fn new_late_param_from_bound(
tcx: TyCtxt<'tcx>,
scope: DefId,
bound: BoundRegion,
) -> Region<'tcx> {
let data =
LateParamRegion { scope, kind: LateParamRegionKind::from_bound(bound.var, bound.kind) };
tcx.intern_region(ty::ReLateParam(data))
}

#[inline]
pub fn new_var(tcx: TyCtxt<'tcx>, v: ty::RegionVid) -> Region<'tcx> {
// Use a pre-interned one when possible.
Expand Down

0 comments on commit a52c918

Please sign in to comment.