Linter suggestion breaks compilation #53925
Labels
A-edition-2018-lints
Area: Lints supporting the 2018 edition
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
I define
#![deny(rust_2018_idioms)]
which implies#![deny(unreachable_pub)]
and I got linter complaining about thepub use
inside private module while I reexport the symbol at crate level.Here is a small example of what I'm talking about
Looks ok. Let's do what linter suggests - change
pub
topub(crate)
and...Get compilation error with '
Bar
is private'Here is how it looks like
What is the correct way to export
Bar
in example? My guess is that second variant is correct, hence linter is correct as well, and the bug is in visibility system somewhere inrustc
. But I'm not an expert here.The text was updated successfully, but these errors were encountered: