don't suggest eliding 'static on associated consts
This commit is contained in:
parent
b835877d2e
commit
73f2ba5ded
2 changed files with 2 additions and 36 deletions
|
|
@ -87,21 +87,5 @@ impl EarlyLintPass for StaticConst {
|
|||
}
|
||||
}
|
||||
|
||||
fn check_trait_item(&mut self, cx: &EarlyContext, item: &TraitItem) {
|
||||
if !in_macro(item.span) {
|
||||
// Match only constants...
|
||||
if let TraitItemKind::Const(ref var_type, _) = item.node {
|
||||
self.visit_type(var_type, cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn check_impl_item(&mut self, cx: &EarlyContext, item: &ImplItem) {
|
||||
if !in_macro(item.span) {
|
||||
// Match only constants...
|
||||
if let ImplItemKind::Const(ref var_type, _) = item.node {
|
||||
self.visit_type(var_type, cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Don't check associated consts because `'static` cannot be elided on those (issue #2438)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue