]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/ptr.rs
use TotalEq for HashMap
[rust.git] / src / libstd / ptr.rs
index 179100255c4fa6c32b3f762276d41783db0a5042..504c613bf4c1763e4e7f15eb53895b37df395c67 100644 (file)
@@ -19,7 +19,7 @@
 use option::{Option, Some, None};
 use intrinsics;
 
-#[cfg(not(test))] use cmp::{Eq, Ord};
+#[cfg(not(test))] use cmp::{Eq, TotalEq, Ord};
 
 /// Return the offset of the first null pointer in `buf`.
 #[inline]
@@ -272,6 +272,9 @@ fn eq(&self, other: &*T) -> bool {
     fn ne(&self, other: &*T) -> bool { !self.eq(other) }
 }
 
+#[cfg(not(test))]
+impl<T> TotalEq for *T {}
+
 #[cfg(not(test))]
 impl<T> Eq for *mut T {
     #[inline]
@@ -282,6 +285,9 @@ fn eq(&self, other: &*mut T) -> bool {
     fn ne(&self, other: &*mut T) -> bool { !self.eq(other) }
 }
 
+#[cfg(not(test))]
+impl<T> TotalEq for *mut T {}
+
 // Equivalence for pointers
 #[cfg(not(test))]
 impl<T> Equiv<*mut T> for *T {