summary refs log tree commit diff
path: root/src/libcore/hash
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-03-17 10:40:49 +0100
committerSimon Sapin <simon.sapin@exyr.org>2018-03-17 11:07:02 +0100
commitc5f020a64014d461ce997ea6e2e801f17aa44b08 (patch)
tree6ed18984f240f8748e7787ddc6a9fd2067c97b30 /src/libcore/hash
parentcc34ca1c9787fde84116637a0cee92fc5e375e3d (diff)
downloadrust-c5f020a64014d461ce997ea6e2e801f17aa44b08.tar.gz
rust-c5f020a64014d461ce997ea6e2e801f17aa44b08.zip
Make the deprecated unstable SipHasher24 type private.
It is still used by the deprecated *stable* `SipHasher` type.
Diffstat (limited to 'src/libcore/hash')
-rw-r--r--src/libcore/hash/mod.rs2
-rw-r--r--src/libcore/hash/sip.rs45
2 files changed, 7 insertions, 40 deletions
diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs
index 15545a04b64..90d9ab3644a 100644
--- a/src/libcore/hash/mod.rs
+++ b/src/libcore/hash/mod.rs
@@ -101,7 +101,7 @@ pub use self::sip::SipHasher;
 
 #[unstable(feature = "sip_hash_13", issue = "34767")]
 #[allow(deprecated)]
-pub use self::sip::{SipHasher13, SipHasher24};
+pub use self::sip::SipHasher13;
 
 mod sip;
 
diff --git a/src/libcore/hash/sip.rs b/src/libcore/hash/sip.rs
index 4e4d9b3f1e2..7790118fbde 100644
--- a/src/libcore/hash/sip.rs
+++ b/src/libcore/hash/sip.rs
@@ -38,7 +38,7 @@ pub struct SipHasher13 {
 #[rustc_deprecated(since = "1.13.0",
                    reason = "use `std::collections::hash_map::DefaultHasher` instead")]
 #[derive(Debug, Clone, Default)]
-pub struct SipHasher24 {
+struct SipHasher24 {
     hasher: Hasher<Sip24Rounds>,
 }
 
@@ -156,7 +156,9 @@ impl SipHasher {
     #[rustc_deprecated(since = "1.13.0",
                        reason = "use `std::collections::hash_map::DefaultHasher` instead")]
     pub fn new_with_keys(key0: u64, key1: u64) -> SipHasher {
-        SipHasher(SipHasher24::new_with_keys(key0, key1))
+        SipHasher(SipHasher24 {
+            hasher: Hasher::new_with_keys(key0, key1)
+        })
     }
 }
 
@@ -182,28 +184,6 @@ impl SipHasher13 {
     }
 }
 
-impl SipHasher24 {
-    /// Creates a new `SipHasher24` with the two initial keys set to 0.
-    #[inline]
-    #[unstable(feature = "sip_hash_13", issue = "34767")]
-    #[rustc_deprecated(since = "1.13.0",
-                       reason = "use `std::collections::hash_map::DefaultHasher` instead")]
-    pub fn new() -> SipHasher24 {
-        SipHasher24::new_with_keys(0, 0)
-    }
-
-    /// Creates a `SipHasher24` that is keyed off the provided keys.
-    #[inline]
-    #[unstable(feature = "sip_hash_13", issue = "34767")]
-    #[rustc_deprecated(since = "1.13.0",
-                       reason = "use `std::collections::hash_map::DefaultHasher` instead")]
-    pub fn new_with_keys(key0: u64, key1: u64) -> SipHasher24 {
-        SipHasher24 {
-            hasher: Hasher::new_with_keys(key0, key1)
-        }
-    }
-}
-
 impl<S: Sip> Hasher<S> {
     #[inline]
     fn new_with_keys(key0: u64, key1: u64) -> Hasher<S> {
@@ -271,12 +251,12 @@ impl<S: Sip> Hasher<S> {
 impl super::Hasher for SipHasher {
     #[inline]
     fn write(&mut self, msg: &[u8]) {
-        self.0.write(msg)
+        self.0.hasher.write(msg)
     }
 
     #[inline]
     fn finish(&self) -> u64 {
-        self.0.finish()
+        self.0.hasher.finish()
     }
 }
 
@@ -293,19 +273,6 @@ impl super::Hasher for SipHasher13 {
     }
 }
 
-#[unstable(feature = "sip_hash_13", issue = "34767")]
-impl super::Hasher for SipHasher24 {
-    #[inline]
-    fn write(&mut self, msg: &[u8]) {
-        self.hasher.write(msg)
-    }
-
-    #[inline]
-    fn finish(&self) -> u64 {
-        self.hasher.finish()
-    }
-}
-
 impl<S: Sip> super::Hasher for Hasher<S> {
     // see short_write comment for explanation
     #[inline]