I am trying to build a data structure that contains a HashSet of structs that contains HashMaps but it seems that neither HashMap nor HashSet implement the Hash trait since trying to derive Hash for the struct results in the following error:
<anon>:6:5: 6:38 error: the trait `core::hash::Hash` is not implemented for the type `std::collections::hash::map::HashMap<collections::string::String, collections::string::String>` [E0277] <anon>:6 pub vars: HashMap<String, String>, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <anon>:4:39: 4:43 note: in this expansion of #[derive_Hash] (defined in <anon>) <anon>:6:5: 6:38 help: see the detailed explanation for E0277 <anon>:6:5: 6:38 note: required by `core::hash::Hash::hash` error: aborting due to previous error playpen: application terminated with error code 101
Here is the isolated case: http://is.gd/PpR71b
What is the motivation for not implementing the Hash trait for HashMap (and HashSet)? Is the only way to get this to work to manually implement the Hash trait for struct
Foo that contains the HashMap?