I’ve just been bitten by these rules. I have a program which does something like this:
enum DebugPrint {
Print,
NoPrint,
}
mod mir {
pub fn build_and_write(..., print_llir: ::DebugPrint) {
...
}
}
with code similar to this, I get the following warning:
warning: private type `DebugPrint` in public interface (error E0446), #[warn(private_in_public)] on by default
--> src/mir/mod.rs:1151:3
|
1151 | pub fn build_and_write(mut self, output: &str, print_llir: ::DebugPrint) {
| ^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
I can’t do anything about this, except make DebugPrint pub, which I really don’t want to do. Until pub(restricted) is actually implemented, warning about it seems really unfortunate and mean; it sucks to see this warning, and know that I have to make my code worse in order to get rid of a warning.
If it warned when you had something reachable, that would be different, but this is just a stupid, unfixable warning.