mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
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:
parent
df7ab62a06
commit
f3d7415bd6
14 changed files with 125 additions and 85 deletions
|
@ -772,16 +772,6 @@ impl NameRefClass {
|
|||
.map(GenericParam::LifetimeParam)
|
||||
.map(Definition::GenericParam)
|
||||
.map(NameRefClass::Definition),
|
||||
// lifetime bounds, as in the 'b in 'a: 'b aren't wrapped in TypeBound nodes so we gotta check
|
||||
// if our lifetime is in a LifetimeParam without being the constrained lifetime
|
||||
_ if ast::LifetimeParam::cast(parent).and_then(|param| param.lifetime()).as_ref()
|
||||
!= Some(lifetime) =>
|
||||
{
|
||||
sema.resolve_lifetime_param(lifetime)
|
||||
.map(GenericParam::LifetimeParam)
|
||||
.map(Definition::GenericParam)
|
||||
.map(NameRefClass::Definition)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue