X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=clippy_lints%2Fsrc%2Funsafe_removed_from_name.rs;h=58af6e9d28146491235055263dd67176c6093937;hb=e5a5b0a0774625eebbe7b29c67b49dc6431544d1;hp=deeeefb88ab5770671eeb0e57ade8c0d1f915e25;hpb=753c39672ec091c55e83ee80a8b86a0725492903;p=rust.git diff --git a/clippy_lints/src/unsafe_removed_from_name.rs b/clippy_lints/src/unsafe_removed_from_name.rs index deeeefb88ab..58af6e9d281 100644 --- a/clippy_lints/src/unsafe_removed_from_name.rs +++ b/clippy_lints/src/unsafe_removed_from_name.rs @@ -1,9 +1,10 @@ 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 @@ -30,7 +31,7 @@ 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); } } @@ -72,6 +73,7 @@ fn unsafe_to_safe_check(old_name: Ident, new_name: Ident, cx: &EarlyContext<'_>, } } -fn contains_unsafe(name: &LocalInternedString) -> bool { +#[must_use] +fn contains_unsafe(name: &SymbolStr) -> bool { name.contains("Unsafe") || name.contains("unsafe") }