We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5792244 commit 9c04454Copy full SHA for 9c04454
src/libcore/ptr.rs
@@ -18,6 +18,7 @@ export buf_len;
18
export position;
19
export Ptr;
20
21
+import cmp::Eq;
22
import libc::{c_void, size_t};
23
24
#[nolink]
@@ -170,6 +171,11 @@ impl<T> *T: Ptr {
170
171
pure fn is_not_null() -> bool { is_not_null(self) }
172
}
173
174
+// Equality for pointers
175
+impl<T: Eq> *T : Eq {
176
+ pure fn eq(&&other: *T) -> bool { self == other }
177
+}
178
+
179
#[test]
180
fn test() {
181
unsafe {
0 commit comments