Open
Description
pub struct X2<T>(T, T);
impl<T> X2<*mut T> {
pub fn foo(self, a: *mut T) -> Self {
unsafe { self.bar(a) }
}
pub unsafe fn bar(self, _a: *mut T) -> Self {
self
}
}
fn main() {}
produces
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> src/main.rs:5:27
|
5 | unsafe { self.bar(a) }
| ^
|
= note: #[deny(not_unsafe_ptr_arg_deref)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#not_unsafe_ptr_arg_deref
which is incorrect since no raw pointer is ever dereferenced anywhere.