Static rustc_lint::builtin::UNREACHABLE_PUB
source · pub static UNREACHABLE_PUB: &Lint
Expand description
The unreachable_pub
lint triggers for pub
items not reachable from
the crate root.
Example
ⓘ
#![deny(unreachable_pub)]
mod foo {
pub mod bar {
}
}
{{produces}}
Explanation
A bare pub
visibility may be misleading if the item is not actually
publicly exported from the crate. The pub(crate)
visibility is
recommended to be used instead, which more clearly expresses the intent
that the item is only visible within its own crate.
This lint is “allow” by default because it will trigger for a large amount existing Rust code, and has some false-positives. Eventually it is desired for this to become warn-by-default.