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:
@@ -410,11 +410,11 @@ impl<'tcx> AutoTraitFinder<'tcx> {
|
||||
iter::zip(new_args.regions(), old_args.regions())
|
||||
{
|
||||
match (*new_region, *old_region) {
|
||||
// If both predicates have an `ReLateBound` (a HRTB) in the
|
||||
// If both predicates have an `ReBound` (a HRTB) in the
|
||||
// same spot, we do nothing.
|
||||
(ty::ReLateBound(_, _), ty::ReLateBound(_, _)) => {}
|
||||
(ty::ReBound(_, _), ty::ReBound(_, _)) => {}
|
||||
|
||||
(ty::ReLateBound(_, _), _) | (_, ty::ReVar(_)) => {
|
||||
(ty::ReBound(_, _), _) | (_, ty::ReVar(_)) => {
|
||||
// One of these is true:
|
||||
// The new predicate has a HRTB in a spot where the old
|
||||
// predicate does not (if they both had a HRTB, the previous
|
||||
@@ -440,7 +440,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
|
||||
// `user_computed_preds`.
|
||||
return false;
|
||||
}
|
||||
(_, ty::ReLateBound(_, _)) | (ty::ReVar(_), _) => {
|
||||
(_, ty::ReBound(_, _)) | (ty::ReVar(_), _) => {
|
||||
// This is the opposite situation as the previous arm.
|
||||
// One of these is true:
|
||||
//
|
||||
|
||||
@@ -740,7 +740,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
}
|
||||
|
||||
// We `erase_late_bound_regions` here because `make_subregion` does not handle
|
||||
// `ReLateBound`, and we don't particularly care about the regions.
|
||||
// `ReBound`, and we don't particularly care about the regions.
|
||||
let real_ty = self.tcx.erase_late_bound_regions(real_trait_pred.self_ty());
|
||||
if !self.can_eq(obligation.param_env, real_ty, arg_ty) {
|
||||
continue;
|
||||
|
||||
@@ -894,16 +894,16 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for BoundVarReplacer<'_, 'tcx> {
|
||||
|
||||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
match *r {
|
||||
ty::ReLateBound(debruijn, _)
|
||||
if debruijn.as_usize() + 1
|
||||
> self.current_index.as_usize() + self.universe_indices.len() =>
|
||||
ty::ReBound(debruijn, _)
|
||||
if debruijn.as_usize()
|
||||
>= self.current_index.as_usize() + self.universe_indices.len() =>
|
||||
{
|
||||
bug!(
|
||||
"Bound vars {r:#?} outside of `self.universe_indices`: {:#?}",
|
||||
self.universe_indices
|
||||
);
|
||||
}
|
||||
ty::ReLateBound(debruijn, br) if debruijn >= self.current_index => {
|
||||
ty::ReBound(debruijn, br) if debruijn >= self.current_index => {
|
||||
let universe = self.universe_for(debruijn);
|
||||
let p = ty::PlaceholderRegion { universe, bound: br };
|
||||
self.mapped_regions.insert(p, br);
|
||||
@@ -1034,7 +1034,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
|
||||
let db = ty::DebruijnIndex::from_usize(
|
||||
self.universe_indices.len() - index + self.current_index.as_usize() - 1,
|
||||
);
|
||||
ty::Region::new_late_bound(self.interner(), db, *replace_var)
|
||||
ty::Region::new_bound(self.interner(), db, *replace_var)
|
||||
}
|
||||
None => r1,
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for MaxEscapingBoundVarVisitor {
|
||||
#[inline]
|
||||
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 => {
|
||||
self.escaping =
|
||||
self.escaping.max(debruijn.as_usize() - self.outer_index.as_usize());
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
let kind = ty::BoundRegionKind::BrNamed(param.def_id, param.name);
|
||||
let bound_var = ty::BoundVariableKind::Region(kind);
|
||||
bound_vars.push(bound_var);
|
||||
ty::Region::new_late_bound(
|
||||
ty::Region::new_bound(
|
||||
tcx,
|
||||
ty::INNERMOST,
|
||||
ty::BoundRegion {
|
||||
|
||||
@@ -3103,7 +3103,7 @@ fn bind_coroutine_hidden_types_above<'tcx>(
|
||||
kind: ty::BrAnon,
|
||||
};
|
||||
counter += 1;
|
||||
ty::Region::new_late_bound(tcx, current_depth, br)
|
||||
ty::Region::new_bound(tcx, current_depth, br)
|
||||
}
|
||||
r => bug!("unexpected region: {r:?}"),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user