From c14d86fd3ff3ba2d01a6e859290b30e74081313b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 9 Jun 2015 11:18:03 -0700 Subject: 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 --- src/libcore/hash/mod.rs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/libcore/hash/mod.rs') 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(&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(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(value: &T) -> u64 { let mut h: H = Default::default(); value.hash(&mut h); -- cgit 1.4.1-3-g733a5