@@ -23,22 +23,23 @@ use mem;
23
23
/// (eg. `collections::HashMap` uses it by default).
24
24
///
25
25
/// See: <https://131002.net/siphash>
26
- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
26
+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
27
27
#[ rustc_deprecated( since = "1.13.0" ,
28
28
reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
29
29
#[ derive( Debug , Clone , Default ) ]
30
+ #[ doc( hidden) ]
30
31
pub struct SipHasher13 {
31
32
hasher : Hasher < Sip13Rounds > ,
32
33
}
33
34
34
35
/// An implementation of SipHash 2-4.
35
36
///
36
37
/// See: <https://131002.net/siphash/>
37
- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
38
+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
38
39
#[ rustc_deprecated( since = "1.13.0" ,
39
40
reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
40
41
#[ derive( Debug , Clone , Default ) ]
41
- pub struct SipHasher24 {
42
+ struct SipHasher24 {
42
43
hasher : Hasher < Sip24Rounds > ,
43
44
}
44
45
@@ -156,14 +157,16 @@ impl SipHasher {
156
157
#[ rustc_deprecated( since = "1.13.0" ,
157
158
reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
158
159
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
+ } )
160
163
}
161
164
}
162
165
163
166
impl SipHasher13 {
164
167
/// Creates a new `SipHasher13` with the two initial keys set to 0.
165
168
#[ inline]
166
- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
169
+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
167
170
#[ rustc_deprecated( since = "1.13.0" ,
168
171
reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
169
172
pub fn new ( ) -> SipHasher13 {
@@ -172,7 +175,7 @@ impl SipHasher13 {
172
175
173
176
/// Creates a `SipHasher13` that is keyed off the provided keys.
174
177
#[ inline]
175
- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
178
+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
176
179
#[ rustc_deprecated( since = "1.13.0" ,
177
180
reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
178
181
pub fn new_with_keys ( key0 : u64 , key1 : u64 ) -> SipHasher13 {
@@ -182,28 +185,6 @@ impl SipHasher13 {
182
185
}
183
186
}
184
187
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
-
207
188
impl < S : Sip > Hasher < S > {
208
189
#[ inline]
209
190
fn new_with_keys ( key0 : u64 , key1 : u64 ) -> Hasher < S > {
@@ -271,16 +252,16 @@ impl<S: Sip> Hasher<S> {
271
252
impl super :: Hasher for SipHasher {
272
253
#[ inline]
273
254
fn write ( & mut self , msg : & [ u8 ] ) {
274
- self . 0 . write ( msg)
255
+ self . 0 . hasher . write ( msg)
275
256
}
276
257
277
258
#[ inline]
278
259
fn finish ( & self ) -> u64 {
279
- self . 0 . finish ( )
260
+ self . 0 . hasher . finish ( )
280
261
}
281
262
}
282
263
283
- #[ unstable( feature = "sip_hash_13 " , issue = "34767 " ) ]
264
+ #[ unstable( feature = "hashmap_internals " , issue = "0 " ) ]
284
265
impl super :: Hasher for SipHasher13 {
285
266
#[ inline]
286
267
fn write ( & mut self , msg : & [ u8 ] ) {
@@ -293,19 +274,6 @@ impl super::Hasher for SipHasher13 {
293
274
}
294
275
}
295
276
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
-
309
277
impl < S : Sip > super :: Hasher for Hasher < S > {
310
278
// see short_write comment for explanation
311
279
#[ inline]
0 commit comments