Extend HIR to track the source and syntax of a lifetime

An upcoming lint will want to be able to know if a lifetime is
hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`,
`ContainsLifetime<'_>`). It will also want to know if the lifetime is
related to a reference (`&u8`) or a path (`ContainsLifetime`).
This commit is contained in:
Jake Goulding
2025-03-28 08:45:33 -04:00
parent 553600e0f5
commit 2a5c349f42
6 changed files with 226 additions and 112 deletions

View File

@@ -58,7 +58,8 @@ fn trait_object_roundtrips_impl(syntax: TraitObjectSyntax) {
hir_id: HirId::INVALID,
ident: Ident::new(sym::name, DUMMY_SP),
kind: LifetimeKind::Static,
is_anon_in_path: IsAnonInPath::No,
source: LifetimeSource::Other,
syntax: LifetimeSyntax::Hidden,
}
},
syntax,