use TotalEq for HashMap

Closes #5283
auto merge of #13088 : thestinger/rust/hashmap, r=cmr

Closes #5283