Removed unnecessary restriction of unsafe_removed_from_name to top-level use statements
This commit is contained in:
parent
b793ad7f2f
commit
4be11e9116
1 changed files with 2 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use rustc::hir::*;
|
||||
use rustc::lint::*;
|
||||
use syntax::ast::{Name, NodeId};
|
||||
use syntax::ast::Name;
|
||||
use syntax::codemap::Span;
|
||||
use syntax::parse::token::InternedString;
|
||||
use utils::span_lint;
|
||||
|
|
@ -33,16 +33,7 @@ impl LintPass for UnsafeNameRemoval {
|
|||
}
|
||||
|
||||
impl LateLintPass for UnsafeNameRemoval {
|
||||
fn check_mod(&mut self, cx: &LateContext, m: &Mod, _: Span, _: NodeId) {
|
||||
// only check top level `use` statements
|
||||
for item in &m.item_ids {
|
||||
self.lint_item(cx, cx.krate.item(item.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl UnsafeNameRemoval {
|
||||
fn lint_item(&self, cx: &LateContext, item: &Item) {
|
||||
fn check_item(&mut self, cx: &LateContext, item: &Item) {
|
||||
if let ItemUse(ref item_use) = item.node {
|
||||
match item_use.node {
|
||||
ViewPath_::ViewPathSimple(ref name, ref path) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue