use crate::utils::span_lint;
+use rustc::declare_lint_pass;
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
-use rustc::{declare_lint_pass, declare_tool_lint};
+use rustc_session::declare_tool_lint;
use syntax::ast::*;
use syntax::source_map::Span;
-use syntax::symbol::LocalInternedString;
+use syntax::symbol::SymbolStr;
declare_clippy_lint! {
/// **What it does:** Checks for imports that remove "unsafe" from an item's
impl EarlyLintPass for UnsafeNameRemoval {
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
- if let ItemKind::Use(ref use_tree) = item.node {
+ if let ItemKind::Use(ref use_tree) = item.kind {
check_use_tree(use_tree, cx, item.span);
}
}
}
}
-fn contains_unsafe(name: &LocalInternedString) -> bool {
+#[must_use]
+fn contains_unsafe(name: &SymbolStr) -> bool {
name.contains("Unsafe") || name.contains("unsafe")
}