Should public_private_dependencies consider unreachable visibility? #130079
Labels
C-bug
Category: This is a bug.
F-public_private_dependencies
feature: public_private_dependencies
L-public_private_dependencies
Lint: public_private_dependencies
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
I tried this code:
with cargo's public-dependency feature enabled, and
regex
is a private dependency.I expected to see this happen: No warning
Instead, this happened: Generated a warning about the dependency in a public interface, but there is no exposure of the dependency in the public interface.
In #44663 (comment), bjorn3 mentioned:
However, I'm not sure I completely agree with that reasoning. In the example above, there is no exposure of the private dependency in any types. This would make more sense if
unreachable-pub
was on by default, but it's not. Although I can sympathize that unreachablepub
is probably bad form, it is very common in Rust code and would be a significant hurdle for false-positives ofexported_private_dependencies
.Meta
The text was updated successfully, but these errors were encountered: