From a52c918bb60e4766ab6da722636e109c32e77de7 Mon Sep 17 00:00:00 2001 From: lcnr Date: Fri, 6 Dec 2024 14:51:04 +0100 Subject: [PATCH] w --- compiler/rustc_borrowck/src/universal_regions.rs | 3 ++- compiler/rustc_middle/src/ty/fold.rs | 3 ++- compiler/rustc_middle/src/ty/region.rs | 11 ----------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs index 8a80bb2c370ae..cd58cc0b6309e 100644 --- a/compiler/rustc_borrowck/src/universal_regions.rs +++ b/compiler/rustc_borrowck/src/universal_regions.rs @@ -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, diff --git a/compiler/rustc_middle/src/ty/fold.rs b/compiler/rustc_middle/src/ty/fold.rs index cbb793afaed48..067516917ef77 100644 --- a/compiler/rustc_middle/src/ty/fold.rs +++ b/compiler/rustc_middle/src/ty/fold.rs @@ -270,7 +270,8 @@ impl<'tcx> TyCtxt<'tcx> { T: TypeFoldable>, { 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) }) } diff --git a/compiler/rustc_middle/src/ty/region.rs b/compiler/rustc_middle/src/ty/region.rs index d7977bad6cb53..0300e1b8cc0ae 100644 --- a/compiler/rustc_middle/src/ty/region.rs +++ b/compiler/rustc_middle/src/ty/region.rs @@ -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.