Make #991 work with current rust
This commit is contained in:
parent
0e3dcd1376
commit
31948c4815
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user