diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-17 20:48:07 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 08:26:20 -0800 |
| commit | f83e23ad7c464c242c2d7ace7212d323980b2bca (patch) | |
| tree | 4af495be32288f7af75d660173a19e412c9a29d8 /src/libtest | |
| parent | dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5 (diff) | |
| download | rust-f83e23ad7c464c242c2d7ace7212d323980b2bca.tar.gz rust-f83e23ad7c464c242c2d7ace7212d323980b2bca.zip | |
std: Stabilize the `hash` module
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 1 | ||||
| -rw-r--r-- | src/libtest/stats.rs | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 2cb30ad9804..a03048e39b9 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -37,7 +37,6 @@ #![feature(collections)] #![feature(core)] #![feature(env)] -#![feature(hash)] #![feature(int_uint)] #![feature(old_io)] #![feature(old_path)] diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 04617757465..e7b5820006b 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -12,7 +12,7 @@ use std::cmp::Ordering::{self, Less, Greater, Equal}; use std::collections::hash_map::Entry::{Occupied, Vacant}; -use std::collections::hash_map::{self, Hasher}; +use std::collections::hash_map; use std::hash::Hash; use std::mem; use std::num::{Float, FromPrimitive}; @@ -333,7 +333,7 @@ pub fn winsorize<T: Float + FromPrimitive>(samples: &mut [T], pct: T) { /// Returns a HashMap with the number of occurrences of every element in the /// sequence that the iterator exposes. pub fn freq_count<T, U>(iter: T) -> hash_map::HashMap<U, uint> - where T: Iterator<Item=U>, U: Eq + Clone + Hash<Hasher> + where T: Iterator<Item=U>, U: Eq + Clone + Hash { let mut map: hash_map::HashMap<U,uint> = hash_map::HashMap::new(); for elem in iter { |
