From d2f236d11640d5972bcba2d5f3c2131e06136511 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bennet=20Ble=C3=9Fmann?= Date: Sat, 6 Jul 2024 13:06:13 +0200 Subject: [PATCH] clippy: explicit ptr addrs comparision relevant for wide pointers i.e. pointers with metadata --- src/arena.rs | 2 +- src/rcu.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arena.rs b/src/arena.rs index bf78f39c..f88973dd 100644 --- a/src/arena.rs +++ b/src/arena.rs @@ -227,7 +227,7 @@ impl PartialOrd for TypedArenaPtr { impl PartialEq for TypedArenaPtr { fn eq(&self, other: &TypedArenaPtr) -> bool { - self.0 == other.0 || **self == **other + std::ptr::addr_eq(self.0.as_ptr(), other.0.as_ptr()) || **self == **other } } diff --git a/src/rcu.rs b/src/rcu.rs index a3e8d2ab..75ecef31 100644 --- a/src/rcu.rs +++ b/src/rcu.rs @@ -193,7 +193,7 @@ impl RcuRef { } pub fn ptr_eq(this: &Self, other: &Self) -> bool { - this.data == other.data + std::ptr::addr_eq(this.data.as_ptr(), other.data.as_ptr()) } pub fn clone(this: &Self) -> Self { -- 2.54.0