Fix use_self false positive on use statements
This commit is contained in:
parent
82044946cd
commit
5ade9ff44e
2 changed files with 17 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
|||
use crate::rustc::ty;
|
||||
use crate::rustc::{declare_tool_lint, lint_array};
|
||||
use crate::syntax_pos::symbol::keywords::SelfType;
|
||||
use crate::syntax::ast::NodeId;
|
||||
|
||||
/// **What it does:** Checks for unnecessary repetition of structure name when a
|
||||
/// replacement with `Self` is applicable.
|
||||
|
|
@ -234,6 +235,10 @@ impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
|
|||
walk_path(self, path);
|
||||
}
|
||||
|
||||
fn visit_use(&mut self, _path: &'tcx Path, _id: NodeId, _hir_id: HirId) {
|
||||
// Don't check use statements
|
||||
}
|
||||
|
||||
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
|
||||
NestedVisitorMap::All(&self.cx.tcx.hir)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue