Make #991 work with current rust

This commit is contained in:
Manish Goregaokar 2016-07-03 13:55:23 +05:30
parent 0e3dcd1376
commit 31948c4815
No known key found for this signature in database
GPG Key ID: 3BBF4D3E2EF79F98

View File

@ -131,7 +131,7 @@ impl Functions {
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 @@ 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,