Make lifetime errors more precise in the presence of Fresh
lifetimes.
This commit is contained in:
parent
8da27078d3
commit
da175c743c
27 changed files with 433 additions and 45 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue