enforce HashMap to use TotalEq, fixes #5283