-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
No warning for unread pub struct field in private module #119545
Copy link
Copy link
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected a "field
bazis never read" warning for both Bar1 and Bar2 structs. Instead, I only got this warning for Bar2.Meta
rustc --version --verbose:Same behavior when running
RUSTUP_TOOLCHAIN=nightly-2024-01-01-x86_64-apple-darwin cargo checkRUSTUP_TOOLCHAIN=nightly-2024-01-01-x86_64-apple-darwin rustc --version --verbose: