diff options
| author | bors <bors@rust-lang.org> | 2015-02-19 18:36:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-19 18:36:59 +0000 |
| commit | 522d09dfecbeca1595f25ac58c6d0178bbd21d7d (patch) | |
| tree | cc0252dd3413e5f890d0ebcfdaa096e5b002be0b /src/libstd/collections/hash/state.rs | |
| parent | 0b664bb8436f2cfda7f13a6f302ab486f332816f (diff) | |
| parent | 49771bafa5fca16486bfd06741dac3de2c587adf (diff) | |
| download | rust-1.0.0-alpha.2.tar.gz rust-1.0.0-alpha.2.zip | |
Auto merge of #22541 - Manishearth:rollup, r=Gankro 1.0.0-alpha.2
Continued from #22520
Diffstat (limited to 'src/libstd/collections/hash/state.rs')
| -rw-r--r-- | src/libstd/collections/hash/state.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/collections/hash/state.rs b/src/libstd/collections/hash/state.rs index 79e01304fb8..7e6dd45b51e 100644 --- a/src/libstd/collections/hash/state.rs +++ b/src/libstd/collections/hash/state.rs @@ -11,6 +11,7 @@ use clone::Clone; use default::Default; use hash; +use marker; /// A trait representing stateful hashes which can be used to hash keys in a /// `HashMap`. @@ -37,7 +38,7 @@ pub trait HashState { /// /// This struct has is 0-sized and does not need construction. #[unstable(feature = "std_misc", reason = "hasher stuff is unclear")] -pub struct DefaultState<H>; +pub struct DefaultState<H>(marker::PhantomData<H>); impl<H: Default + hash::Hasher> HashState for DefaultState<H> { type Hasher = H; @@ -45,9 +46,9 @@ impl<H: Default + hash::Hasher> HashState for DefaultState<H> { } impl<H> Clone for DefaultState<H> { - fn clone(&self) -> DefaultState<H> { DefaultState } + fn clone(&self) -> DefaultState<H> { DefaultState(marker::PhantomData) } } impl<H> Default for DefaultState<H> { - fn default() -> DefaultState<H> { DefaultState } + fn default() -> DefaultState<H> { DefaultState(marker::PhantomData) } } |
