From 91049bc03be6a15f10f898fee89ad03a05bb886d Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 22 Jan 2022 14:46:07 -0700 Subject: Suppress clippy::not_unsafe_ptr_arg_deref warnings in ptrace on BSD Technically these functions don't violate Rust's safety rules, because libc::ptrace doesn't dereference those pointer args. Instead, it passes them directly to the kernel. --- src/sys/ptrace/bsd.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/sys/ptrace/bsd.rs b/src/sys/ptrace/bsd.rs index ac7d8312..c4cc7403 100644 --- a/src/sys/ptrace/bsd.rs +++ b/src/sys/ptrace/bsd.rs @@ -167,6 +167,9 @@ pub fn step>>(pid: Pid, sig: T) -> Result<()> { } /// Reads a word from a processes memory at the given address +// Technically, ptrace doesn't dereference the pointer. It passes it directly +// to the kernel. +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub fn read(pid: Pid, addr: AddressType) -> Result { unsafe { // Traditionally there was a difference between reading data or @@ -176,6 +179,9 @@ pub fn read(pid: Pid, addr: AddressType) -> Result { } /// Writes a word into the processes memory at the given address +// Technically, ptrace doesn't dereference the pointer. It passes it directly +// to the kernel. +#[allow(clippy::not_unsafe_ptr_arg_deref)] pub fn write(pid: Pid, addr: AddressType, data: c_int) -> Result<()> { unsafe { ptrace_other(Request::PT_WRITE_D, pid, addr, data).map(drop) } } -- cgit v1.2.3