Open laralove143 opened 2 years ago
unreachable_pub
trips when a pub
item would be unreachable from a different crate using the current crate as a dependency, even if it can be reached in the current crate. The solution here is to either mark Foo
as pub(crate)
or allow unreachable_pub
(which is nice for binaries where the distinction between pub
and pub(crate)
doesn't matter as much).
This is for a library but nothing in this module should be public, I prefer this way and if I do pub(crate) clippy complains with https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate so these lints are conflicting? Which one should I listen
It seems like that's is a known bug in clippy::redundant_pub_crate
, which caused the lint to be moved to the clippy::nursery
category.
I tried this code:
Here's a link for the same code on playground
I expected to see this happen: No warning, as the item is actually accessible from the root crate
Instead, this happened: It says the item is unreachable, even though it isn't