]> git.lizzy.rs Git - rust.git/commitdiff
Deprecate Equiv
authorJorge Aparicio <japaricious@gmail.com>
Thu, 27 Nov 2014 04:50:12 +0000 (23:50 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Wed, 3 Dec 2014 15:41:48 +0000 (10:41 -0500)
src/libcollections/str.rs
src/libcollections/string.rs
src/libcollections/vec.rs
src/libcore/cmp.rs
src/libcore/ptr.rs
src/libcore/slice.rs
src/libcore/str.rs
src/libgraphviz/maybe_owned_vec.rs
src/libstd/collections/hash/map.rs
src/libsyntax/parse/token.rs

index c6fa1332186ec7562cd817ba0af9160653575f2e..ad0a5e76176464fdcd2611adc612d7e284d76b82 100644 (file)
@@ -563,6 +563,7 @@ fn cmp(&self, other: &MaybeOwned) -> Ordering {
     }
 }
 
+#[allow(deprecated)]
 #[deprecated = "use std::str::CowString"]
 impl<'a, S: Str> Equiv<S> for MaybeOwned<'a> {
     #[inline]
index 8917afa34b149a27521578bdeee935ce272e140f..fbb0bb5c4ce8673cf5fa71d3d34914a65d2ce024 100644 (file)
@@ -822,7 +822,8 @@ fn hash(&self, hasher: &mut H) {
     }
 }
 
-#[experimental = "waiting on Equiv stabilization"]
+#[allow(deprecated)]
+#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
 impl<'a, S: Str> Equiv<S> for String {
     #[inline]
     fn equiv(&self, other: &S) -> bool {
index c40f0c19c09f888459312f04db62affbaa89f646..2396cf8cec67ce20d235031f3a44e8888728b2c7 100644 (file)
@@ -609,7 +609,8 @@ fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering> {
 #[unstable = "waiting on Eq stability"]
 impl<T: Eq> Eq for Vec<T> {}
 
-#[experimental]
+#[allow(deprecated)]
+#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
 impl<T: PartialEq, Sized? V: AsSlice<T>> Equiv<V> for Vec<T> {
     #[inline]
     fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
index d5001a08b1dc5d7ee4084cefe93500f7b2dc782d..df19256471ede6db1caffc05207901bdc2955564 100644 (file)
@@ -240,7 +240,7 @@ fn ge(&self, other: &Rhs) -> bool {
 /// of different types. The most common use case for this relation is
 /// container types; e.g. it is often desirable to be able to use `&str`
 /// values to look up entries in a container with `String` keys.
-#[experimental = "Better solutions may be discovered."]
+#[deprecated = "Use overloaded core::cmp::PartialEq"]
 pub trait Equiv<Sized? T> for Sized? {
     /// Implement this function to decide equivalent values.
     fn equiv(&self, other: &T) -> bool;
index 5e2f5529e8d4971d80b149fb0ea65e97ba7a5405..416bc4588b43ca03945b1fd1529d7ea36b2c04a5 100644 (file)
@@ -321,12 +321,16 @@ fn ne(&self, other: &*mut T) -> bool { !self.eq(other) }
 impl<T> Eq for *mut T {}
 
 // Equivalence for pointers
+#[allow(deprecated)]
+#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
 impl<T> Equiv<*mut T> for *const T {
     fn equiv(&self, other: &*mut T) -> bool {
         self.to_uint() == other.to_uint()
     }
 }
 
+#[allow(deprecated)]
+#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
 impl<T> Equiv<*const T> for *mut T {
     fn equiv(&self, other: &*const T) -> bool {
         self.to_uint() == other.to_uint()
index 12cd20584a180adab4ba5a109e1ecf6cb9a60945..85bd6adf8b8a60b60acc6b77603e8102769fa836 100644 (file)
@@ -1816,13 +1816,15 @@ fn ne(&self, other: &[B]) -> bool {
 #[unstable = "waiting for DST"]
 impl<T: Eq> Eq for [T] {}
 
-#[unstable = "waiting for DST"]
+#[allow(deprecated)]
+#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
 impl<T: PartialEq, Sized? V: AsSlice<T>> Equiv<V> for [T] {
     #[inline]
     fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
 }
 
-#[unstable = "waiting for DST"]
+#[allow(deprecated)]
+#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
 impl<'a,T:PartialEq, Sized? V: AsSlice<T>> Equiv<V> for &'a mut [T] {
     #[inline]
     fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
index b9586399aec5d19ee143b1358e9df285c8a25aec..4be628f0ac3b3c757ca4af02beea1d88dc12ade6 100644 (file)
@@ -1248,6 +1248,8 @@ fn partial_cmp(&self, other: &str) -> Option<Ordering> {
         }
     }
 
+    #[allow(deprecated)]
+    #[deprecated = "Use overloaded `core::cmp::PartialEq`"]
     impl<S: Str> Equiv<S> for str {
         #[inline]
         fn equiv(&self, other: &S) -> bool { eq_slice(self, other.as_slice()) }
index 6482a514115aaa3e1c823cf60f5982c1a3c72f98..05932db6632ffdcb7aa3d5119ff6ed8b4d2dcb56 100644 (file)
@@ -96,6 +96,7 @@ fn cmp(&self, other: &MaybeOwnedVector<T>) -> Ordering {
     }
 }
 
+#[allow(deprecated)]
 impl<'a, T: PartialEq, Sized? V: AsSlice<T>> Equiv<V> for MaybeOwnedVector<'a, T> {
     fn equiv(&self, other: &V) -> bool {
         self.as_slice() == other.as_slice()
index 50a00714ea06cc036e21c750fb9cee5a6b9a9d79..bd07dbf5c91841ac188b653c791e5dcc29c81b70 100644 (file)
@@ -425,12 +425,14 @@ fn make_hash<Sized? X: Hash<S>>(&self, x: &X) -> SafeHash {
         table::make_hash(&self.hasher, x)
     }
 
+    #[allow(deprecated)]
     fn search_equiv<'a, Sized? Q: Hash<S> + Equiv<K>>(&'a self, q: &Q)
                     -> Option<FullBucketImm<'a, K, V>> {
         let hash = self.make_hash(q);
         search_hashed(&self.table, &hash, |k| q.equiv(k)).into_option()
     }
 
+    #[allow(deprecated)]
     fn search_equiv_mut<'a, Sized? Q: Hash<S> + Equiv<K>>(&'a mut self, q: &Q)
                     -> Option<FullBucketMut<'a, K, V>> {
         let hash = self.make_hash(q);
index 1376f59d79fcf03452de450f35129db020bd6097..52b54bc7f2d6dc81cde165c9a90757a869b1cbbb 100644 (file)
@@ -623,6 +623,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
+#[allow(deprecated)]
 impl<'a> Equiv<&'a str> for InternedString {
     fn equiv(&self, other: & &'a str) -> bool {
         (*other) == self.string.as_slice()