Reduce diagnostic type visibilities.

Most diagnostic types are only used within their own crate, and so have
a `pub(crate)` visibility. We have some diagnostic types that are
unnecessarily `pub`. This is bad because (a) information hiding, and (b)
if a `pub(crate)` type becomes unused the compiler will warn but it
won't warn for a `pub` type.

This commit eliminates unnecessary `pub` visibilities for some
diagnostic types, and also some related things due to knock-on effects.
(I found these types with some ad hoc use of `grep`.)
This commit is contained in:
Nicholas Nethercote
2026-04-16 07:42:17 +10:00
parent 9620eae30a
commit 9b64d52d78
14 changed files with 165 additions and 165 deletions
@@ -4,7 +4,7 @@
#[derive(Diagnostic)]
#[diag("could not emit MIR: {$error}")]
pub struct CantEmitMIR {
pub(crate) struct CantEmitMIR {
pub error: std::io::Error,
}