Fixes for rustc update

Get it building again.

Note that this adds a couple of `panic!`s because I didn't know how else to handle the condition of the directories that are in use becoming invalid. Maybe someone has a better idea but I think it's probably okay to `panic!` here.