Fix dead code warnings with Rust beta
I usually use beta, and I just updated it. It's better at detecting dead code than it used to be, so there are new warnings. In this MR I fix most of them.
However, there are some I didn't know what to do with, for which I have filed #1383 (closed), and put allows in temporarily, so that we can get the build clean before we know what to do with the loose ends.