Mark deprecated unstable SipHasher13 as a doc-hidden impl detail of HashMap.

It stays in libcore rather than being private in HashMap’s module
because it shares code with the deprecated *stable* `SipHasher` type.
This commit is contained in:
Simon Sapin 2018-03-17 11:07:50 +01:00
parent c5f020a640
commit 89ecb0d542
4 changed files with 10 additions and 9 deletions

View File

@ -99,8 +99,9 @@ use mem;
#[allow(deprecated)]
pub use self::sip::SipHasher;
#[unstable(feature = "sip_hash_13", issue = "34767")]
#[unstable(feature = "hashmap_internals", issue = "0")]
#[allow(deprecated)]
#[doc(hidden)]
pub use self::sip::SipHasher13;
mod sip;

View File

@ -23,10 +23,11 @@ use mem;
/// (eg. `collections::HashMap` uses it by default).
///
/// See: <https://131002.net/siphash>
#[unstable(feature = "sip_hash_13", issue = "34767")]
#[unstable(feature = "hashmap_internals", issue = "0")]
#[rustc_deprecated(since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead")]
#[derive(Debug, Clone, Default)]
#[doc(hidden)]
pub struct SipHasher13 {
hasher: Hasher<Sip13Rounds>,
}
@ -34,7 +35,7 @@ pub struct SipHasher13 {
/// An implementation of SipHash 2-4.
///
/// See: <https://131002.net/siphash/>
#[unstable(feature = "sip_hash_13", issue = "34767")]
#[unstable(feature = "hashmap_internals", issue = "0")]
#[rustc_deprecated(since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead")]
#[derive(Debug, Clone, Default)]
@ -165,7 +166,7 @@ impl SipHasher {
impl SipHasher13 {
/// Creates a new `SipHasher13` with the two initial keys set to 0.
#[inline]
#[unstable(feature = "sip_hash_13", issue = "34767")]
#[unstable(feature = "hashmap_internals", issue = "0")]
#[rustc_deprecated(since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead")]
pub fn new() -> SipHasher13 {
@ -174,7 +175,7 @@ impl SipHasher13 {
/// Creates a `SipHasher13` that is keyed off the provided keys.
#[inline]
#[unstable(feature = "sip_hash_13", issue = "34767")]
#[unstable(feature = "hashmap_internals", issue = "0")]
#[rustc_deprecated(since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead")]
pub fn new_with_keys(key0: u64, key1: u64) -> SipHasher13 {
@ -260,7 +261,7 @@ impl super::Hasher for SipHasher {
}
}
#[unstable(feature = "sip_hash_13", issue = "34767")]
#[unstable(feature = "hashmap_internals", issue = "0")]
impl super::Hasher for SipHasher13 {
#[inline]
fn write(&mut self, msg: &[u8]) {

View File

@ -21,6 +21,7 @@
#![feature(fixed_size_array)]
#![feature(flt2dec)]
#![feature(fmt_internals)]
#![feature(hashmap_internals)]
#![feature(iterator_step_by)]
#![feature(i128_type)]
#![cfg_attr(stage0, feature(inclusive_range_syntax))]
@ -35,7 +36,6 @@
#![feature(range_is_empty)]
#![feature(raw)]
#![feature(refcell_replace_swap)]
#![feature(sip_hash_13)]
#![feature(slice_patterns)]
#![feature(sort_internals)]
#![feature(specialization)]

View File

@ -267,7 +267,7 @@
#![feature(fn_traits)]
#![feature(fnbox)]
#![feature(generic_param_attrs)]
#![feature(hashmap_hasher)]
#![feature(hashmap_internals)]
#![feature(heap_api)]
#![feature(i128)]
#![feature(i128_type)]
@ -298,7 +298,6 @@
#![feature(raw)]
#![feature(rustc_attrs)]
#![feature(stdsimd)]
#![feature(sip_hash_13)]
#![feature(slice_bytes)]
#![feature(slice_concat_ext)]
#![feature(slice_internals)]