]> Repositorios git - scryer-prolog.git/commitdiff
clippy: explicit ptr addrs comparision
authorBennet Bleßmann <[email protected]>
Sat, 6 Jul 2024 11:06:13 +0000 (13:06 +0200)
committerBennet Bleßmann <[email protected]>
Sat, 6 Jul 2024 11:06:13 +0000 (13:06 +0200)
relevant for wide pointers i.e. pointers with metadata

src/arena.rs
src/rcu.rs

index bf78f39c582d4c4e0d1cbedb8635051affc4fc07..f88973dd59963c10dfaf15c74dc04f456dbe20c7 100644 (file)
@@ -227,7 +227,7 @@ impl<T: ?Sized + PartialOrd> PartialOrd for TypedArenaPtr<T> {
 
 impl<T: ?Sized + PartialEq> PartialEq for TypedArenaPtr<T> {
     fn eq(&self, other: &TypedArenaPtr<T>) -> bool {
-        self.0 == other.0 || **self == **other
+        std::ptr::addr_eq(self.0.as_ptr(), other.0.as_ptr()) || **self == **other
     }
 }
 
index a3e8d2ab0ae11d8db13ed6a3f12e562ab09bff0e..75ecef317ff220d00e193200b374f219551b192b 100644 (file)
@@ -193,7 +193,7 @@ impl<T: ?Sized, M: ?Sized> RcuRef<T, M> {
     }
 
     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 {