Skip to content

Commit 8eadbfd

Browse files
committed
parent_def_id -> parent
1 parent dcbd3ae commit 8eadbfd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_lints/src/use_self.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rustc::hir::*;
55
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
66
use rustc::ty;
77
use rustc::{declare_tool_lint, lint_array};
8+
use rustc::ty::DefIdTree;
89
use rustc_errors::Applicability;
910
use syntax_pos::symbol::keywords::SelfUpper;
1011

@@ -233,7 +234,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
233234
if self.item_path.def == path.def {
234235
span_use_self_lint(self.cx, path);
235236
} else if let Def::StructCtor(ctor_did, CtorKind::Fn) = path.def {
236-
if self.item_path.def.opt_def_id() == self.cx.tcx.parent_def_id(ctor_did) {
237+
if self.item_path.def.opt_def_id() == self.cx.tcx.parent(ctor_did) {
237238
span_use_self_lint(self.cx, path);
238239
}
239240
}

0 commit comments

Comments
 (0)