From: Bennet Bleßmann Date: Sat, 6 Jul 2024 11:06:13 +0000 (+0200) Subject: clippy: explicit ptr addrs comparision X-Git-Tag: v0.10.0~127^2~28 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=d2f236d11640d5972bcba2d5f3c2131e06136511;p=scryer-prolog.git clippy: explicit ptr addrs comparision relevant for wide pointers i.e. pointers with metadata --- 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 {