Skip to content

Commit c390bda

Browse files
committed
Record RPITs elided lifetimes in Rptr Tys
1 parent 1802d45 commit c390bda

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

compiler/rustc_ast_lowering/src/lifetime_collector.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ impl<'ast> Visitor<'ast> for LifetimeCollectVisitor<'ast> {
6464
visit::walk_ty(self, t);
6565
self.current_binders.pop();
6666
}
67+
TyKind::Rptr(None, _) => {
68+
if let Some(LifetimeRes::ElidedAnchor { start, end }) =
69+
self.resolver.get_lifetime_res(t.id)
70+
{
71+
for i in start..end {
72+
let lifetime =
73+
Lifetime { id: i, ident: Ident::new(kw::UnderscoreLifetime, t.span) };
74+
self.record_lifetime_use(lifetime);
75+
}
76+
}
77+
visit::walk_ty(self, t);
78+
}
6779
_ => {
6880
visit::walk_ty(self, t);
6981
}

0 commit comments

Comments
 (0)