about summary refs log tree commit diff
path: root/src/libcore/hash/mod.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-06-09 11:18:03 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-06-17 09:06:59 -0700
commitc14d86fd3ff3ba2d01a6e859290b30e74081313b (patch)
tree79ec999c2885ff0d2f3b9836be5938bc0d6339b4 /src/libcore/hash/mod.rs
parente7a5a1c33a7794a97eb11a38cc576375a3553a64 (diff)
downloadrust-c14d86fd3ff3ba2d01a6e859290b30e74081313b.tar.gz
rust-c14d86fd3ff3ba2d01a6e859290b30e74081313b.zip
core: Split apart the global `core` feature
This commit shards the broad `core` feature of the libcore library into finer
grained features. This split groups together similar APIs and enables tracking
each API separately, giving a better sense of where each feature is within the
stabilization process.

A few minor APIs were deprecated along the way:

* Iterator::reverse_in_place
* marker::NoCopy
Diffstat (limited to 'src/libcore/hash/mod.rs')
-rw-r--r--src/libcore/hash/mod.rs27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs
index e848a44e01c..cbf2828a7dc 100644
--- a/src/libcore/hash/mod.rs
+++ b/src/libcore/hash/mod.rs
@@ -89,7 +89,8 @@ pub trait Hash {
     fn hash<H: Hasher>(&self, state: &mut H);
 
     /// Feeds a slice of this type into the state provided.
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hash_slice",
+               reason = "module was recently redesigned")]
     fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where Self: Sized {
         for piece in data {
             piece.hash(state);
@@ -110,29 +111,29 @@ pub trait Hasher {
 
     /// Write a single `u8` into this hasher
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_u8(&mut self, i: u8) { self.write(&[i]) }
     /// Write a single `u16` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_u16(&mut self, i: u16) {
         self.write(&unsafe { mem::transmute::<_, [u8; 2]>(i) })
     }
     /// Write a single `u32` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_u32(&mut self, i: u32) {
         self.write(&unsafe { mem::transmute::<_, [u8; 4]>(i) })
     }
     /// Write a single `u64` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_u64(&mut self, i: u64) {
         self.write(&unsafe { mem::transmute::<_, [u8; 8]>(i) })
     }
     /// Write a single `usize` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_usize(&mut self, i: usize) {
         if cfg!(target_pointer_width = "32") {
             self.write_u32(i as u32)
@@ -143,23 +144,23 @@ pub trait Hasher {
 
     /// Write a single `i8` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_i8(&mut self, i: i8) { self.write_u8(i as u8) }
     /// Write a single `i16` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_i16(&mut self, i: i16) { self.write_u16(i as u16) }
     /// Write a single `i32` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_i32(&mut self, i: i32) { self.write_u32(i as u32) }
     /// Write a single `i64` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_i64(&mut self, i: i64) { self.write_u64(i as u64) }
     /// Write a single `isize` into this hasher.
     #[inline]
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
     fn write_isize(&mut self, i: isize) { self.write_usize(i as usize) }
 }
 
@@ -167,7 +168,9 @@ pub trait Hasher {
 ///
 /// The specified value will be hashed with this hasher and then the resulting
 /// hash will be returned.
-#[unstable(feature = "hash", reason = "module was recently redesigned")]
+#[unstable(feature = "hash_default",
+           reason = "not the most ergonomic interface unless `H` is defaulted \
+                     to SipHasher, but perhaps not ready to commit to that")]
 pub fn hash<T: Hash, H: Hasher + Default>(value: &T) -> u64 {
     let mut h: H = Default::default();
     value.hash(&mut h);