Parse lifetime bounds in lifetime param into TypeBoundList

This mainly aids in error recovery but also makes it a bit easier to handle lifetime resolution.
While doing so it also came apparent that we were not actually lowering lifetime outlives relationships within lifetime parameter declaration bounds, so this fixes that.
This commit is contained in:
Lukas Wirth 2024-12-05 14:37:38 +01:00
parent df7ab62a06
commit f3d7415bd6
14 changed files with 125 additions and 85 deletions

View file

@ -290,15 +290,14 @@ pub(crate) struct ParamContext {
/// The state of the lifetime we are completing.
#[derive(Debug)]
pub(crate) struct LifetimeContext {
pub(crate) lifetime: Option<ast::Lifetime>,
pub(crate) kind: LifetimeKind,
}
/// The kind of lifetime we are completing.
#[derive(Debug)]
pub(crate) enum LifetimeKind {
LifetimeParam { is_decl: bool, param: ast::LifetimeParam },
Lifetime,
LifetimeParam,
Lifetime { in_lifetime_param_bound: bool, def: Option<hir::GenericDef> },
LabelRef,
LabelDef,
}