From 6f2a1c946744dd6c1de7a1c556cb1333592dec62 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 12 Feb 2015 12:46:40 -0500 Subject: [PATCH] Fallout: add phantomdata to hash --- src/libstd/collections/hash/state.rs | 7 ++++--- 1 file 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; +pub struct DefaultState(marker::PhantomData); impl HashState for DefaultState { type Hasher = H; @@ -45,9 +46,9 @@ impl HashState for DefaultState { } impl Clone for DefaultState { - fn clone(&self) -> DefaultState { DefaultState } + fn clone(&self) -> DefaultState { DefaultState(marker::PhantomData) } } impl Default for DefaultState { - fn default() -> DefaultState { DefaultState } + fn default() -> DefaultState { DefaultState(marker::PhantomData) } }