Lint elided lifetimes in path on the AST.
This commit is contained in:
@@ -95,7 +95,7 @@ pub enum LifetimeName {
|
||||
/// User wrote nothing (e.g., the lifetime in `&u32`).
|
||||
///
|
||||
/// The bool indicates whether the user should have written something.
|
||||
Implicit(bool),
|
||||
Implicit,
|
||||
|
||||
/// Implicit lifetime in a context like `dyn Foo`. This is
|
||||
/// distinguished from implicit lifetimes elsewhere because the
|
||||
@@ -125,7 +125,7 @@ impl LifetimeName {
|
||||
pub fn ident(&self) -> Ident {
|
||||
match *self {
|
||||
LifetimeName::ImplicitObjectLifetimeDefault
|
||||
| LifetimeName::Implicit(_)
|
||||
| LifetimeName::Implicit
|
||||
| LifetimeName::Error => Ident::empty(),
|
||||
LifetimeName::Underscore => Ident::with_dummy_span(kw::UnderscoreLifetime),
|
||||
LifetimeName::Static => Ident::with_dummy_span(kw::StaticLifetime),
|
||||
@@ -136,7 +136,7 @@ impl LifetimeName {
|
||||
pub fn is_elided(&self) -> bool {
|
||||
match self {
|
||||
LifetimeName::ImplicitObjectLifetimeDefault
|
||||
| LifetimeName::Implicit(_)
|
||||
| LifetimeName::Implicit
|
||||
| LifetimeName::Underscore => true,
|
||||
|
||||
// It might seem surprising that `Fresh(_)` counts as
|
||||
|
||||
Reference in New Issue
Block a user