cmp: rm TotalOrd impl code duplication
add a TotalEq trait
auto merge of #5587 : thestinger/rust/total, r=pcwalton

This is needed so that hash tables can require strict equality but not require types to be ordered. It's a subset of the functionality of `TotalOrd` so I made that inherit from `TotalEq`.