parent_def_id -> parent

This commit is contained in:
flip1995 2019-03-15 23:44:04 +01:00
parent dcbd3aefa2
commit 8eadbfd35b
No known key found for this signature in database
GPG key ID: 693086869D506637

View file

@ -5,6 +5,7 @@ use rustc::hir::*;
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::ty; use rustc::ty;
use rustc::{declare_tool_lint, lint_array}; use rustc::{declare_tool_lint, lint_array};
use rustc::ty::DefIdTree;
use rustc_errors::Applicability; use rustc_errors::Applicability;
use syntax_pos::symbol::keywords::SelfUpper; 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 { if self.item_path.def == path.def {
span_use_self_lint(self.cx, path); span_use_self_lint(self.cx, path);
} else if let Def::StructCtor(ctor_did, CtorKind::Fn) = path.def { } 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); span_use_self_lint(self.cx, path);
} }
} }