@@ -23,22 +23,23 @@ use mem;
2323/// (eg. `collections::HashMap` uses it by default).
2424///
2525/// See: <https://131002.net/siphash>
26- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
26+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
2727#[ rustc_deprecated( since = "1.13.0" ,
2828 reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
2929#[ derive( Debug , Clone , Default ) ]
30+ #[ doc( hidden) ]
3031pub struct SipHasher13 {
3132 hasher : Hasher < Sip13Rounds > ,
3233}
3334
3435/// An implementation of SipHash 2-4.
3536///
3637/// See: <https://131002.net/siphash/>
37- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
38+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
3839#[ rustc_deprecated( since = "1.13.0" ,
3940 reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
4041#[ derive( Debug , Clone , Default ) ]
41- pub struct SipHasher24 {
42+ struct SipHasher24 {
4243 hasher : Hasher < Sip24Rounds > ,
4344}
4445
@@ -156,14 +157,16 @@ impl SipHasher {
156157 #[ rustc_deprecated( since = "1.13.0" ,
157158 reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
158159 pub fn new_with_keys ( key0 : u64 , key1 : u64 ) -> SipHasher {
159- SipHasher ( SipHasher24 :: new_with_keys ( key0, key1) )
160+ SipHasher ( SipHasher24 {
161+ hasher : Hasher :: new_with_keys ( key0, key1)
162+ } )
160163 }
161164}
162165
163166impl SipHasher13 {
164167 /// Creates a new `SipHasher13` with the two initial keys set to 0.
165168 #[ inline]
166- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
169+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
167170 #[ rustc_deprecated( since = "1.13.0" ,
168171 reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
169172 pub fn new ( ) -> SipHasher13 {
@@ -172,7 +175,7 @@ impl SipHasher13 {
172175
173176 /// Creates a `SipHasher13` that is keyed off the provided keys.
174177 #[ inline]
175- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
178+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
176179 #[ rustc_deprecated( since = "1.13.0" ,
177180 reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
178181 pub fn new_with_keys ( key0 : u64 , key1 : u64 ) -> SipHasher13 {
@@ -182,28 +185,6 @@ impl SipHasher13 {
182185 }
183186}
184187
185- impl SipHasher24 {
186- /// Creates a new `SipHasher24` with the two initial keys set to 0.
187- #[ inline]
188- #[ unstable( feature = "sip_hash_13" , issue = "34767" ) ]
189- #[ rustc_deprecated( since = "1.13.0" ,
190- reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
191- pub fn new ( ) -> SipHasher24 {
192- SipHasher24 :: new_with_keys ( 0 , 0 )
193- }
194-
195- /// Creates a `SipHasher24` that is keyed off the provided keys.
196- #[ inline]
197- #[ unstable( feature = "sip_hash_13" , issue = "34767" ) ]
198- #[ rustc_deprecated( since = "1.13.0" ,
199- reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
200- pub fn new_with_keys ( key0 : u64 , key1 : u64 ) -> SipHasher24 {
201- SipHasher24 {
202- hasher : Hasher :: new_with_keys ( key0, key1)
203- }
204- }
205- }
206-
207188impl < S : Sip > Hasher < S > {
208189 #[ inline]
209190 fn new_with_keys ( key0 : u64 , key1 : u64 ) -> Hasher < S > {
@@ -271,16 +252,16 @@ impl<S: Sip> Hasher<S> {
271252impl super :: Hasher for SipHasher {
272253 #[ inline]
273254 fn write ( & mut self , msg : & [ u8 ] ) {
274- self . 0 . write ( msg)
255+ self . 0 . hasher . write ( msg)
275256 }
276257
277258 #[ inline]
278259 fn finish ( & self ) -> u64 {
279- self . 0 . finish ( )
260+ self . 0 . hasher . finish ( )
280261 }
281262}
282263
283- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
264+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
284265impl super :: Hasher for SipHasher13 {
285266 #[ inline]
286267 fn write ( & mut self , msg : & [ u8 ] ) {
@@ -293,19 +274,6 @@ impl super::Hasher for SipHasher13 {
293274 }
294275}
295276
296- #[ unstable( feature = "sip_hash_13" , issue = "34767" ) ]
297- impl super :: Hasher for SipHasher24 {
298- #[ inline]
299- fn write ( & mut self , msg : & [ u8 ] ) {
300- self . hasher . write ( msg)
301- }
302-
303- #[ inline]
304- fn finish ( & self ) -> u64 {
305- self . hasher . finish ( )
306- }
307- }
308-
309277impl < S : Sip > super :: Hasher for Hasher < S > {
310278 // see short_write comment for explanation
311279 #[ inline]
0 commit comments