-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
dead_code lint does not trigger for tuple structs with unread fields #92790
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.C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-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.C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-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.
This code:
Produces this warning:
However, switching to a tuple struct:
Does not report a warning.
Original report misleadingly focusing on
Debugproduces
However, switching to a tuple struct:
does not produce the warning.
/cc @FabianWolff
/cc #85200; #84647; #88900
Meta
Rustc 1.57.0 and 1.60.0-nightly (2022-01-10 89b9f7b)