Clean up rustc warnings.

These are basically all straightforward changes and should not impact behavior of the language.
Also, why the move away from `target_os`? Is that now deprecated?