Clean up a bunch of build warnings.
auto merge of #6937 : msullivan/rust/no-warnings, r=catamorphism