compiler: Make middle errors `pub(crate)` and bury the dead code
pub(crate)
For more information about how rustc works, see the rustc dev guide.