Split Bound into Canonical and Bound
This commit is contained in:
@@ -830,7 +830,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for EraseEscapingBoundRegions<'tcx> {
|
||||
}
|
||||
|
||||
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
|
||||
if let ty::ReBound(debruijn, _) = r.kind()
|
||||
if let ty::ReBound(ty::BoundVarIndexKind::Bound(debruijn), _) = r.kind()
|
||||
&& debruijn < self.binder
|
||||
{
|
||||
r
|
||||
|
||||
@@ -145,7 +145,9 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for MaxEscapingBoundVarVisitor {
|
||||
#[inline]
|
||||
fn visit_region(&mut self, r: ty::Region<'tcx>) {
|
||||
match r.kind() {
|
||||
ty::ReBound(debruijn, _) if debruijn > self.outer_index => {
|
||||
ty::ReBound(ty::BoundVarIndexKind::Bound(debruijn), _)
|
||||
if debruijn > self.outer_index =>
|
||||
{
|
||||
self.escaping =
|
||||
self.escaping.max(debruijn.as_usize() - self.outer_index.as_usize());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user