From d223dd1e57cc412aa2eff28e6604f86b9f013083 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Fri, 21 Feb 2014 21:33:23 -0800 Subject: std: rewrite Hash to make it more generic This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version. --- src/libstd/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libstd/lib.rs') diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index d3ddd9ae783..6996cba42b4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -54,6 +54,10 @@ #[feature(macro_rules, globs, asm, managed_boxes, thread_local, link_args, simd)]; +// Turn on default type parameters. +#[feature(default_type_params)]; +#[allow(default_type_param_usage)]; + // Don't link to std. We are std. #[no_std]; @@ -141,6 +145,7 @@ pub mod iter; pub mod to_str; pub mod to_bytes; pub mod clone; +pub mod hash_old; pub mod hash; pub mod container; pub mod default; @@ -213,6 +218,7 @@ mod std { pub use cmp; pub use comm; pub use fmt; + pub use hash; pub use io; pub use kinds; pub use local_data; -- cgit 1.4.1-3-g733a5