mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
parent_def_id -> parent
This commit is contained in:
parent
dcbd3aefa2
commit
8eadbfd35b
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ use rustc::hir::*;
|
|||
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
|
||||
use rustc::ty;
|
||||
use rustc::{declare_tool_lint, lint_array};
|
||||
use rustc::ty::DefIdTree;
|
||||
use rustc_errors::Applicability;
|
||||
use syntax_pos::symbol::keywords::SelfUpper;
|
||||
|
||||
|
@ -233,7 +234,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
|
|||
if self.item_path.def == path.def {
|
||||
span_use_self_lint(self.cx, path);
|
||||
} else if let Def::StructCtor(ctor_did, CtorKind::Fn) = path.def {
|
||||
if self.item_path.def.opt_def_id() == self.cx.tcx.parent_def_id(ctor_did) {
|
||||
if self.item_path.def.opt_def_id() == self.cx.tcx.parent(ctor_did) {
|
||||
span_use_self_lint(self.cx, path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue