rename ReLateBound
to ReBound
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
This commit is contained in:
parent
28328c8389
commit
86fa1317a3
80 changed files with 192 additions and 195 deletions
|
@ -63,7 +63,7 @@ impl CanonicalVarValues<'_> {
|
|||
pub fn is_identity(&self) -> bool {
|
||||
self.var_values.iter().enumerate().all(|(bv, arg)| match arg.unpack() {
|
||||
ty::GenericArgKind::Lifetime(r) => {
|
||||
matches!(*r, ty::ReLateBound(ty::INNERMOST, br) if br.var.as_usize() == bv)
|
||||
matches!(*r, ty::ReBound(ty::INNERMOST, br) if br.var.as_usize() == bv)
|
||||
}
|
||||
ty::GenericArgKind::Type(ty) => {
|
||||
matches!(*ty.kind(), ty::Bound(ty::INNERMOST, bt) if bt.var.as_usize() == bv)
|
||||
|
@ -79,7 +79,7 @@ impl CanonicalVarValues<'_> {
|
|||
for arg in self.var_values {
|
||||
match arg.unpack() {
|
||||
ty::GenericArgKind::Lifetime(r) => {
|
||||
if let ty::ReLateBound(ty::INNERMOST, br) = *r
|
||||
if let ty::ReBound(ty::INNERMOST, br) = *r
|
||||
&& var == br.var
|
||||
{
|
||||
var = var + 1;
|
||||
|
@ -389,7 +389,7 @@ impl<'tcx> CanonicalVarValues<'tcx> {
|
|||
var: ty::BoundVar::from_usize(i),
|
||||
kind: ty::BrAnon,
|
||||
};
|
||||
ty::Region::new_late_bound(tcx, ty::INNERMOST, br).into()
|
||||
ty::Region::new_bound(tcx, ty::INNERMOST, br).into()
|
||||
}
|
||||
CanonicalVarKind::Effect => ty::Const::new_bound(
|
||||
tcx,
|
||||
|
|
|
@ -58,8 +58,7 @@ impl<'tcx> UnifyValue for UnifiedRegion<'tcx> {
|
|||
|
||||
fn unify_values(value1: &Self, value2: &Self) -> Result<Self, NoError> {
|
||||
// We pick the value of the least universe because it is compatible with more variables.
|
||||
// This is *not* necessary for soundness, but it allows more region variables to be
|
||||
// resolved to the said value.
|
||||
// This is *not* necessary for completeness.
|
||||
#[cold]
|
||||
fn min_universe<'tcx>(r1: Region<'tcx>, r2: Region<'tcx>) -> Region<'tcx> {
|
||||
cmp::min_by_key(r1, r2, |r| match r.kind() {
|
||||
|
@ -69,7 +68,7 @@ impl<'tcx> UnifyValue for UnifiedRegion<'tcx> {
|
|||
| ty::ReEarlyBound(..)
|
||||
| ty::ReError(_) => ty::UniverseIndex::ROOT,
|
||||
ty::RePlaceholder(placeholder) => placeholder.universe,
|
||||
ty::ReVar(..) | ty::ReLateBound(..) => bug!("not a universal region"),
|
||||
ty::ReVar(..) | ty::ReBound(..) => bug!("not a universal region"),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ impl<'tcx> ClosureOutlivesSubjectTy<'tcx> {
|
|||
let inner = tcx.fold_regions(ty, |r, depth| match r.kind() {
|
||||
ty::ReVar(vid) => {
|
||||
let br = ty::BoundRegion { var: ty::BoundVar::new(vid.index()), kind: ty::BrAnon };
|
||||
ty::Region::new_late_bound(tcx, depth, br)
|
||||
ty::Region::new_bound(tcx, depth, br)
|
||||
}
|
||||
_ => bug!("unexpected region in ClosureOutlivesSubjectTy: {r:?}"),
|
||||
});
|
||||
|
@ -430,7 +430,7 @@ impl<'tcx> ClosureOutlivesSubjectTy<'tcx> {
|
|||
mut map: impl FnMut(ty::RegionVid) -> ty::Region<'tcx>,
|
||||
) -> Ty<'tcx> {
|
||||
tcx.fold_regions(self.inner, |r, depth| match r.kind() {
|
||||
ty::ReLateBound(debruijn, br) => {
|
||||
ty::ReBound(debruijn, br) => {
|
||||
debug_assert_eq!(debruijn, depth);
|
||||
map(ty::RegionVid::new(br.var.index()))
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ pub struct CommonLifetimes<'tcx> {
|
|||
pub re_vars: Vec<Region<'tcx>>,
|
||||
|
||||
/// Pre-interned values of the form:
|
||||
/// `ReLateBound(DebruijnIndex(i), BoundRegion { var: v, kind: BrAnon })`
|
||||
/// `ReBound(DebruijnIndex(i), BoundRegion { var: v, kind: BrAnon })`
|
||||
/// for small values of `i` and `v`.
|
||||
pub re_late_bounds: Vec<Vec<Region<'tcx>>>,
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ impl<'tcx> CommonLifetimes<'tcx> {
|
|||
.map(|i| {
|
||||
(0..NUM_PREINTERNED_RE_LATE_BOUNDS_V)
|
||||
.map(|v| {
|
||||
mk(ty::ReLateBound(
|
||||
mk(ty::ReBound(
|
||||
ty::DebruijnIndex::from(i),
|
||||
ty::BoundRegion { var: ty::BoundVar::from(v), kind: ty::BrAnon },
|
||||
))
|
||||
|
|
|
@ -53,16 +53,11 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RegionEraserVisitor<'tcx> {
|
|||
}
|
||||
|
||||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
// because late-bound regions affect subtyping, we can't
|
||||
// erase the bound/free distinction, but we can replace
|
||||
// all free regions with 'erased.
|
||||
//
|
||||
// Note that we *CAN* replace early-bound regions -- the
|
||||
// type system never "sees" those, they get substituted
|
||||
// away. In codegen, they will always be erased to 'erased
|
||||
// whenever a substitution occurs.
|
||||
// We must not erase bound regions. `for<'a> fn(&'a ())` and
|
||||
// `fn(&'free ())` are different types: they may implement different
|
||||
// traits and have a different `TypeId`.
|
||||
match *r {
|
||||
ty::ReLateBound(..) => r,
|
||||
ty::ReBound(..) => r,
|
||||
_ => self.tcx.lifetimes.re_erased,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ impl FlagComputation {
|
|||
|
||||
fn add_region(&mut self, r: ty::Region<'_>) {
|
||||
self.add_flags(r.type_flags());
|
||||
if let ty::ReLateBound(debruijn, _) = *r {
|
||||
if let ty::ReBound(debruijn, _) = *r {
|
||||
self.add_bound_var(debruijn);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,12 +68,10 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
/// Folds over the substructure of a type, visiting its component
|
||||
/// types and all regions that occur *free* within it.
|
||||
///
|
||||
/// That is, `Ty` can contain function or method types that bind
|
||||
/// regions at the call site (`ReLateBound`), and occurrences of
|
||||
/// regions (aka "lifetimes") that are bound within a type are not
|
||||
/// visited by this folder; only regions that occur free will be
|
||||
/// That is, function pointer types and trait object can introduce
|
||||
/// new bound regions which are not visited by this visitors as
|
||||
/// they are not free; only regions that occur free will be
|
||||
/// visited by `fld_r`.
|
||||
|
||||
pub struct RegionFolder<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
|
||||
|
@ -117,7 +115,7 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for RegionFolder<'a, 'tcx> {
|
|||
#[instrument(skip(self), level = "debug", ret)]
|
||||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
match *r {
|
||||
ty::ReLateBound(debruijn, _) if debruijn < self.current_index => {
|
||||
ty::ReBound(debruijn, _) if debruijn < self.current_index => {
|
||||
debug!(?self.current_index, "skipped bound region");
|
||||
r
|
||||
}
|
||||
|
@ -205,15 +203,15 @@ where
|
|||
|
||||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
match *r {
|
||||
ty::ReLateBound(debruijn, br) if debruijn == self.current_index => {
|
||||
ty::ReBound(debruijn, br) if debruijn == self.current_index => {
|
||||
let region = self.delegate.replace_region(br);
|
||||
if let ty::ReLateBound(debruijn1, br) = *region {
|
||||
// If the callback returns a late-bound region,
|
||||
if let ty::ReBound(debruijn1, br) = *region {
|
||||
// If the callback returns a bound region,
|
||||
// that region should always use the INNERMOST
|
||||
// debruijn index. Then we adjust it to the
|
||||
// correct depth.
|
||||
assert_eq!(debruijn1, ty::INNERMOST);
|
||||
ty::Region::new_late_bound(self.tcx, debruijn, br)
|
||||
ty::Region::new_bound(self.tcx, debruijn, br)
|
||||
} else {
|
||||
region
|
||||
}
|
||||
|
@ -341,7 +339,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
value,
|
||||
FnMutDelegate {
|
||||
regions: &mut |r: ty::BoundRegion| {
|
||||
ty::Region::new_late_bound(
|
||||
ty::Region::new_bound(
|
||||
self,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion { var: shift_bv(r.var), kind: r.kind },
|
||||
|
@ -388,7 +386,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
.or_insert_with(|| ty::BoundVariableKind::Region(ty::BrAnon))
|
||||
.expect_region();
|
||||
let br = ty::BoundRegion { var, kind };
|
||||
ty::Region::new_late_bound(self.tcx, ty::INNERMOST, br)
|
||||
ty::Region::new_bound(self.tcx, ty::INNERMOST, br)
|
||||
}
|
||||
fn replace_ty(&mut self, bt: ty::BoundTy) -> Ty<'tcx> {
|
||||
let entry = self.map.entry(bt.var);
|
||||
|
@ -454,9 +452,9 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Shifter<'tcx> {
|
|||
|
||||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
match *r {
|
||||
ty::ReLateBound(debruijn, br) if debruijn >= self.current_index => {
|
||||
ty::ReBound(debruijn, br) if debruijn >= self.current_index => {
|
||||
let debruijn = debruijn.shifted_in(self.amount);
|
||||
ty::Region::new_late_bound(self.tcx, debruijn, br)
|
||||
ty::Region::new_bound(self.tcx, debruijn, br)
|
||||
}
|
||||
_ => r,
|
||||
}
|
||||
|
@ -496,8 +494,8 @@ pub fn shift_region<'tcx>(
|
|||
amount: u32,
|
||||
) -> ty::Region<'tcx> {
|
||||
match *region {
|
||||
ty::ReLateBound(debruijn, br) if amount > 0 => {
|
||||
ty::Region::new_late_bound(tcx, debruijn.shifted_in(amount), br)
|
||||
ty::ReBound(debruijn, br) if amount > 0 => {
|
||||
ty::Region::new_bound(tcx, debruijn.shifted_in(amount), br)
|
||||
}
|
||||
_ => region,
|
||||
}
|
||||
|
|
|
@ -843,7 +843,7 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for ArgFolder<'a, 'tcx> {
|
|||
None => region_param_out_of_range(data, self.args),
|
||||
}
|
||||
}
|
||||
ty::ReLateBound(..)
|
||||
ty::ReBound(..)
|
||||
| ty::ReFree(_)
|
||||
| ty::ReStatic
|
||||
| ty::RePlaceholder(_)
|
||||
|
|
|
@ -102,8 +102,9 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
|
|||
// Ignore bound regions and `'static` regions that appear in the
|
||||
// type, we only need to remap regions that reference lifetimes
|
||||
// from the function declaration.
|
||||
// This would ignore `'r` in a type like `for<'r> fn(&'r u32)`.
|
||||
ty::ReLateBound(..) | ty::ReStatic => return r,
|
||||
//
|
||||
// E.g. We ignore `'r` in a type like `for<'r> fn(&'r u32)`.
|
||||
ty::ReBound(..) | ty::ReStatic => return r,
|
||||
|
||||
// If regions have been erased (by writeback), don't try to unerase
|
||||
// them.
|
||||
|
|
|
@ -2160,7 +2160,7 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
|
|||
match *region {
|
||||
ty::ReEarlyBound(ref data) => data.has_name(),
|
||||
|
||||
ty::ReLateBound(_, ty::BoundRegion { kind: br, .. })
|
||||
ty::ReBound(_, ty::BoundRegion { kind: br, .. })
|
||||
| ty::ReFree(ty::FreeRegion { bound_region: br, .. })
|
||||
| ty::RePlaceholder(ty::Placeholder {
|
||||
bound: ty::BoundRegion { kind: br, .. }, ..
|
||||
|
@ -2234,7 +2234,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
|||
return Ok(());
|
||||
}
|
||||
}
|
||||
ty::ReLateBound(_, ty::BoundRegion { kind: br, .. })
|
||||
ty::ReBound(_, ty::BoundRegion { kind: br, .. })
|
||||
| ty::ReFree(ty::FreeRegion { bound_region: br, .. })
|
||||
| ty::RePlaceholder(ty::Placeholder {
|
||||
bound: ty::BoundRegion { kind: br, .. }, ..
|
||||
|
@ -2315,7 +2315,7 @@ impl<'a, 'tcx> ty::TypeFolder<TyCtxt<'tcx>> for RegionFolder<'a, 'tcx> {
|
|||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
let name = &mut self.name;
|
||||
let region = match *r {
|
||||
ty::ReLateBound(db, br) if db >= self.current_index => {
|
||||
ty::ReBound(db, br) if db >= self.current_index => {
|
||||
*self.region_map.entry(br).or_insert_with(|| name(Some(db), self.current_index, br))
|
||||
}
|
||||
ty::RePlaceholder(ty::PlaceholderRegion {
|
||||
|
@ -2338,9 +2338,9 @@ impl<'a, 'tcx> ty::TypeFolder<TyCtxt<'tcx>> for RegionFolder<'a, 'tcx> {
|
|||
}
|
||||
_ => return r,
|
||||
};
|
||||
if let ty::ReLateBound(debruijn1, br) = *region {
|
||||
if let ty::ReBound(debruijn1, br) = *region {
|
||||
assert_eq!(debruijn1, ty::INNERMOST);
|
||||
ty::Region::new_late_bound(self.tcx, self.current_index, br)
|
||||
ty::Region::new_bound(self.tcx, self.current_index, br)
|
||||
} else {
|
||||
region
|
||||
}
|
||||
|
@ -2450,7 +2450,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
|||
if let Some(lt_idx) = lifetime_idx {
|
||||
if lt_idx > binder_level_idx {
|
||||
let kind = ty::BrNamed(CRATE_DEF_ID.to_def_id(), name);
|
||||
return ty::Region::new_late_bound(
|
||||
return ty::Region::new_bound(
|
||||
tcx,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion { var: br.var, kind },
|
||||
|
@ -2466,7 +2466,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
|||
if let Some(lt_idx) = lifetime_idx {
|
||||
if lt_idx > binder_level_idx {
|
||||
let kind = ty::BrNamed(def_id, name);
|
||||
return ty::Region::new_late_bound(
|
||||
return ty::Region::new_bound(
|
||||
tcx,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion { var: br.var, kind },
|
||||
|
@ -2480,7 +2480,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
|||
if let Some(lt_idx) = lifetime_idx {
|
||||
if lt_idx > binder_level_idx {
|
||||
let kind = br.kind;
|
||||
return ty::Region::new_late_bound(
|
||||
return ty::Region::new_bound(
|
||||
tcx,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion { var: br.var, kind },
|
||||
|
@ -2496,11 +2496,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
|||
start_or_continue(self, "for<", ", ");
|
||||
do_continue(self, name);
|
||||
}
|
||||
ty::Region::new_late_bound(
|
||||
tcx,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion { var: br.var, kind },
|
||||
)
|
||||
ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { var: br.var, kind })
|
||||
};
|
||||
let mut folder = RegionFolder {
|
||||
tcx,
|
||||
|
|
|
@ -1476,7 +1476,7 @@ impl<'tcx> Region<'tcx> {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn new_late_bound(
|
||||
pub fn new_bound(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
debruijn: ty::DebruijnIndex,
|
||||
bound_region: ty::BoundRegion,
|
||||
|
@ -1488,7 +1488,7 @@ impl<'tcx> Region<'tcx> {
|
|||
{
|
||||
re
|
||||
} else {
|
||||
tcx.intern_region(ty::ReLateBound(debruijn, bound_region))
|
||||
tcx.intern_region(ty::ReBound(debruijn, bound_region))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1550,7 +1550,7 @@ impl<'tcx> Region<'tcx> {
|
|||
pub fn new_from_kind(tcx: TyCtxt<'tcx>, kind: RegionKind<'tcx>) -> Region<'tcx> {
|
||||
match kind {
|
||||
ty::ReEarlyBound(region) => Region::new_early_bound(tcx, region),
|
||||
ty::ReLateBound(debruijn, region) => Region::new_late_bound(tcx, debruijn, region),
|
||||
ty::ReBound(debruijn, region) => Region::new_bound(tcx, debruijn, region),
|
||||
ty::ReFree(ty::FreeRegion { scope, bound_region }) => {
|
||||
Region::new_free(tcx, scope, bound_region)
|
||||
}
|
||||
|
@ -1723,7 +1723,7 @@ impl<'tcx> Region<'tcx> {
|
|||
if self.has_name() {
|
||||
match *self {
|
||||
ty::ReEarlyBound(ebr) => Some(ebr.name),
|
||||
ty::ReLateBound(_, br) => br.kind.get_name(),
|
||||
ty::ReBound(_, br) => br.kind.get_name(),
|
||||
ty::ReFree(fr) => fr.bound_region.get_name(),
|
||||
ty::ReStatic => Some(kw::StaticLifetime),
|
||||
ty::RePlaceholder(placeholder) => placeholder.bound.kind.get_name(),
|
||||
|
@ -1745,7 +1745,7 @@ impl<'tcx> Region<'tcx> {
|
|||
pub fn has_name(self) -> bool {
|
||||
match *self {
|
||||
ty::ReEarlyBound(ebr) => ebr.has_name(),
|
||||
ty::ReLateBound(_, br) => br.kind.is_named(),
|
||||
ty::ReBound(_, br) => br.kind.is_named(),
|
||||
ty::ReFree(fr) => fr.bound_region.is_named(),
|
||||
ty::ReStatic => true,
|
||||
ty::ReVar(..) => false,
|
||||
|
@ -1771,8 +1771,8 @@ impl<'tcx> Region<'tcx> {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_late_bound(self) -> bool {
|
||||
matches!(*self, ty::ReLateBound(..))
|
||||
pub fn is_bound(self) -> bool {
|
||||
matches!(*self, ty::ReBound(..))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -1783,7 +1783,7 @@ impl<'tcx> Region<'tcx> {
|
|||
#[inline]
|
||||
pub fn bound_at_or_above_binder(self, index: ty::DebruijnIndex) -> bool {
|
||||
match *self {
|
||||
ty::ReLateBound(debruijn, _) => debruijn >= index,
|
||||
ty::ReBound(debruijn, _) => debruijn >= index,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1814,7 +1814,7 @@ impl<'tcx> Region<'tcx> {
|
|||
ty::ReStatic => {
|
||||
flags = flags | TypeFlags::HAS_FREE_REGIONS;
|
||||
}
|
||||
ty::ReLateBound(..) => {
|
||||
ty::ReBound(..) => {
|
||||
flags = flags | TypeFlags::HAS_RE_LATE_BOUND;
|
||||
}
|
||||
ty::ReErased => {
|
||||
|
|
|
@ -638,7 +638,7 @@ impl<'tcx> IsIdentity for CanonicalUserType<'tcx> {
|
|||
},
|
||||
|
||||
GenericArgKind::Lifetime(r) => match *r {
|
||||
ty::ReLateBound(debruijn, br) => {
|
||||
ty::ReBound(debruijn, br) => {
|
||||
// We only allow a `ty::INNERMOST` index in substitutions.
|
||||
assert_eq!(debruijn, ty::INNERMOST);
|
||||
cvar == br.var
|
||||
|
|
|
@ -468,7 +468,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
for arg in args {
|
||||
match arg.unpack() {
|
||||
GenericArgKind::Lifetime(lt) => match (ignore_regions, lt.kind()) {
|
||||
(CheckRegions::Bound, ty::ReLateBound(di, reg)) => {
|
||||
(CheckRegions::Bound, ty::ReBound(di, reg)) => {
|
||||
if !seen_late.insert((di, reg)) {
|
||||
return Err(NotUniqueParam::DuplicateParam(lt.into()));
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
|
||||
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
match *r {
|
||||
ty::ReLateBound(debruijn, _) if debruijn < self.outer_index => {
|
||||
ty::ReBound(debruijn, _) if debruijn < self.outer_index => {
|
||||
ControlFlow::Continue(())
|
||||
}
|
||||
_ => {
|
||||
|
@ -337,7 +337,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ValidateBoundVars<'tcx> {
|
|||
|
||||
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
match *r {
|
||||
ty::ReLateBound(index, br) if index == self.binder_index => {
|
||||
ty::ReBound(index, br) if index == self.binder_index => {
|
||||
if self.bound_vars.len() <= br.var.as_usize() {
|
||||
bug!("Not enough bound vars: {:?} not found in {:?}", br, self.bound_vars);
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for LateBoundRegionsCollector {
|
|||
}
|
||||
|
||||
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
if let ty::ReLateBound(debruijn, br) = *r {
|
||||
if let ty::ReBound(debruijn, br) = *r {
|
||||
if debruijn == self.current_index {
|
||||
self.regions.insert(br.kind);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue