Record RPITs elided lifetimes in Rptr Tys

This commit is contained in:
Santiago Pastorino 2022-08-02 15:06:12 -03:00
parent 1802d45b12
commit c390bda356
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -64,6 +64,18 @@ impl<'ast> Visitor<'ast> for LifetimeCollectVisitor<'ast> {
visit::walk_ty(self, t);
self.current_binders.pop();
}
TyKind::Rptr(None, _) => {
if let Some(LifetimeRes::ElidedAnchor { start, end }) =
self.resolver.get_lifetime_res(t.id)
{
for i in start..end {
let lifetime =
Lifetime { id: i, ident: Ident::new(kw::UnderscoreLifetime, t.span) };
self.record_lifetime_use(lifetime);
}
}
visit::walk_ty(self, t);
}
_ => {
visit::walk_ty(self, t);
}