1
Fork 0

Make lifetime errors more precise in the presence of Fresh lifetimes.

This commit is contained in:
Camille GILLOT 2022-05-12 21:25:38 +02:00
parent 8da27078d3
commit da175c743c
27 changed files with 433 additions and 45 deletions

View file

@ -131,6 +131,17 @@ impl LifetimeName {
}
}
pub fn is_anonymous(&self) -> bool {
match *self {
LifetimeName::ImplicitObjectLifetimeDefault
| LifetimeName::Implicit
| LifetimeName::Underscore
| LifetimeName::Param(ParamName::Fresh(_))
| LifetimeName::Error => true,
LifetimeName::Static | LifetimeName::Param(_) => false,
}
}
pub fn is_elided(&self) -> bool {
match self {
LifetimeName::ImplicitObjectLifetimeDefault