fn raw_ptr_arg(cx: &LateContext, arg: &hir::Arg) -> Option<hir::def_id::DefId> {
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
}
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,