]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/redundant_static_lifetimes.rs
Auto merge of #5334 - flip1995:backport_remerge, r=flip1995
[rust.git] / clippy_lints / src / redundant_static_lifetimes.rs
index 9cebe310d5fed84d823b8ace827086c535bc33d9..4a7a15aba5be2385865c332a3507158f15cdeca6 100644 (file)
@@ -1,8 +1,8 @@
 use crate::utils::{snippet, span_lint_and_then};
+use rustc_ast::ast::{Item, ItemKind, Ty, TyKind};
 use rustc_errors::Applicability;
 use rustc_lint::{EarlyContext, EarlyLintPass};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
-use syntax::ast::*;
 
 declare_clippy_lint! {
     /// **What it does:** Checks for constants and statics with an explicit `'static` lifetime.
@@ -79,7 +79,7 @@ fn visit_type(&mut self, ty: &Ty, cx: &EarlyContext<'_>, reason: &str) {
 impl EarlyLintPass for RedundantStaticLifetimes {
     fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
         if !item.span.from_expansion() {
-            if let ItemKind::Const(ref var_type, _) = item.kind {
+            if let ItemKind::Const(_, ref var_type, _) = item.kind {
                 self.visit_type(var_type, cx, "Constants have by default a `'static` lifetime");
                 // Don't check associated consts because `'static` cannot be elided on those (issue
                 // #2438)