in_macro, last_line_of_span, match_def_path, opt_def_id, paths, snippet_opt, span_lint, span_lint_and_then,
without_block_comments,
};
-use rustc::hir::*;
-use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use rustc::{declare_lint, lint_array};
+use crate::rustc::hir::*;
+use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
+use crate::rustc::{declare_tool_lint, lint_array};
use if_chain::if_chain;
-use rustc::ty::{self, TyCtxt};
+use crate::rustc::ty::{self, TyCtxt};
use semver::Version;
-use syntax::ast::{AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem, NestedMetaItemKind};
-use syntax::source_map::Span;
+use crate::syntax::ast::{AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem, NestedMetaItemKind};
+use crate::syntax::source_map::Span;
+use crate::rustc_errors::Applicability;
/// **What it does:** Checks for items annotated with `#[inline(always)]`,
/// unless the annotated function is empty or simply panics.
|| is_word(lint, "deprecated") {
return
},
- ItemKind::ExternCrate(..) => if is_word(lint, "unused_imports")
- && skip_unused_imports {
+ ItemKind::ExternCrate(..) => {
+ if is_word(lint, "unused_imports")
+ && skip_unused_imports {
+ return
+ }
+ if is_word(lint, "unused_extern_crates") {
return
- },
+ }
+ }
_ => {},
}
}
"useless lint attribute",
|db| {
sugg = sugg.replacen("#[", "#![", 1);
- db.span_suggestion(line_span, "if you just forgot a `!`, use", sugg);
+ db.span_suggestion_with_applicability(
+ line_span,
+ "if you just forgot a `!`, use",
+ sugg,
+ Applicability::Unspecified,
+ );
},
);
}