Closed
Description
If one does not re-export a public type of a private module no warning is emitted. This is something that which is described in #34537 als a “workaround” and thus apparently intended as a feature.
This is actually pretty bad because it effectively renders the whole private_in_public
-checker useless as it becomes unreliable. Why do we need a lint, if one can accidentally circumvent it? It hit use here: image-rs/image#562
mod outer {
mod inner {
pub struct Private;
pub fn interface() -> Private {
Private
}
}
// This line should cause an error/warning
pub use self::inner::{interface};
}
use outer::{interface};
fn main() {
let _ = interface();
}