Skip to content

Commit 414fc4e

Browse files
committed
Allow comparison-by-address of void pointers
1 parent 302a325 commit 414fc4e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

libcc2rs/src/rc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,10 @@ where
10761076
}
10771077

10781078
fn equals(&self, other: &dyn ErasedPtr) -> bool {
1079-
other.as_any().downcast_ref::<Ptr<T>>() == Some(self)
1079+
if let Some(o) = other.as_any().downcast_ref::<Ptr<T>>() {
1080+
return o == self;
1081+
}
1082+
self.as_bytes() == other.as_bytes()
10801083
}
10811084

10821085
fn is_null(&self) -> bool {

0 commit comments

Comments
 (0)