Warn on elided lifetimes in associated constants
This commit is contained in:
parent
6ef7d16be0
commit
fad7d220fd
8 changed files with 178 additions and 25 deletions
|
@ -966,6 +966,14 @@ pub trait LintContext: Sized {
|
|||
Applicability::MachineApplicable
|
||||
);
|
||||
}
|
||||
BuiltinLintDiagnostics::AssociatedConstElidedLifetime { elided, span } => {
|
||||
db.span_suggestion_verbose(
|
||||
if elided { span.shrink_to_hi() } else { span },
|
||||
"use the `'static` lifetime",
|
||||
if elided { "'static " } else { "'static" },
|
||||
Applicability::MachineApplicable
|
||||
);
|
||||
}
|
||||
}
|
||||
// Rewrap `db`, and pass control to the user.
|
||||
decorate(db)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue