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 {