]> git.lizzy.rs Git - rust.git/commitdiff
Make #991 work with current rust
authorManish Goregaokar <manishsmail@gmail.com>
Sun, 3 Jul 2016 08:25:23 +0000 (13:55 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sun, 3 Jul 2016 08:25:23 +0000 (13:55 +0530)
clippy_lints/src/functions.rs

index a1918aed69f9b30b6d556e46718c05c7324a9184..0dec4e94c0b87d46903d0aaefc384b9ca9f64c55 100644 (file)
@@ -131,7 +131,7 @@ fn check_raw_ptr(&self, cx: &LateContext, unsafety: hir::Unsafety, decl: &hir::F
 
 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
     }
@@ -175,7 +175,7 @@ fn visit_expr(&mut self, expr: &'v hir::Expr) {
 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,