1
Fork 0

Stop creating anonymous late lifetimes.

This commit is contained in:
Camille GILLOT 2022-05-24 08:23:24 +02:00
parent ad1b1819eb
commit 556b02704f
5 changed files with 4 additions and 85 deletions

View file

@ -221,14 +221,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
tcx.mk_region(ty::ReLateBound(debruijn, br))
}
Some(rl::Region::LateBoundAnon(debruijn, index, anon_index)) => {
let br = ty::BoundRegion {
var: ty::BoundVar::from_u32(index),
kind: ty::BrAnon(anon_index),
};
tcx.mk_region(ty::ReLateBound(debruijn, br))
}
Some(rl::Region::EarlyBound(index, id)) => {
let name = lifetime_name(id.expect_local());
tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion { def_id: id, index, name }))

View file

@ -1346,16 +1346,8 @@ fn has_late_bound_regions<'tcx>(tcx: TyCtxt<'tcx>, node: Node<'tcx>) -> Option<S
match self.tcx.named_region(lt.hir_id) {
Some(rl::Region::Static | rl::Region::EarlyBound(..)) => {}
Some(
rl::Region::LateBound(debruijn, _, _)
| rl::Region::LateBoundAnon(debruijn, _, _),
) if debruijn < self.outer_index => {}
Some(
rl::Region::LateBound(..)
| rl::Region::LateBoundAnon(..)
| rl::Region::Free(..),
)
| None => {
Some(rl::Region::LateBound(debruijn, _, _)) if debruijn < self.outer_index => {}
Some(rl::Region::LateBound(..) | rl::Region::Free(..)) | None => {
self.has_late_bound_regions = Some(lt.span);
}
}