diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs index a1918aed69f..0dec4e94c0b 100644 --- a/clippy_lints/src/functions.rs +++ b/clippy_lints/src/functions.rs @@ -131,7 +131,7 @@ impl Functions { fn raw_ptr_arg(cx: &LateContext, arg: &hir::Arg) -> Option { if let (&hir::PatKind::Binding(_, _, _), &hir::TyPtr(_)) = (&arg.pat.node, &arg.ty.node) { - cx.tcx.def_map.borrow().get(&arg.pat.id).map(hir::def::PathResolution::def_id) + cx.tcx.def_map.borrow().get(&arg.pat.id).map(|pr| pr.full_def().def_id()) } else { None } @@ -175,7 +175,7 @@ impl<'a, 'tcx, 'v> hir::intravisit::Visitor<'v> for DerefVisitor<'a, 'tcx> { impl<'a, 'tcx: 'a> DerefVisitor<'a, 'tcx> { fn check_arg(&self, ptr: &hir::Expr) { if let Some(def) = self.cx.tcx.def_map.borrow().get(&ptr.id) { - if self.ptrs.contains(&def.def_id()) { + if self.ptrs.contains(&def.full_def().def_id()) { span_lint(self.cx, NOT_UNSAFE_PTR_ARG_DEREF, ptr.span,