cmp: remove duplicate free functions
auto merge of #7028 : thestinger/rust/cmp, r=brson