-
Notifications
You must be signed in to change notification settings - Fork 13.3k
unreachable_pub
false negative when type is referenced in a public field, even if it is not reachable
#135134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In fact,
shows the incorrect output. Enum variants have an implicit The issue is that a type that is referenced publicly but not reachable publicly is not detected. So, this may be a duplicate of #116604. |
unreachable_pub
false negative when unreachable type is used in an enum variantunreachable_pub
false negative when type is referenced in a public field, even if it is not reachable
Why do you think this is a false positive? In your first example, fn f(config: StorageConfig) {
match config {
StorageConfig::OnDisk(mode) => todo!(),
}
} In fact, removing the
|
What you want is done by the
which is the case here as one can get
While the
@rustbot label +C-discussion |
Ah, thank you! That's an important misunderstanding of the term "reachable" on my part. |
Thanks -- that's great! ❤ |
Code
Current output
Desired output
Rationale and extra context
Changing StorageConfig to
produces the desired output, so this is a difference between a reference to a type from an enum variant and a reference to a type from a struct.
Other cases
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: