-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
"Struct is never constructed" false positive (dead_code) #148144
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.L-dead_codeLint: dead_codeLint: dead_codeL-false-positiveLint: False positive (should not have fired).Lint: False positive (should not have fired).S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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.L-dead_codeLint: dead_codeLint: dead_codeL-false-positiveLint: False positive (should not have fired).Lint: False positive (should not have fired).S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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.
Code
Current output
Desired output
It shouldn't print the compiler warning.
Rationale and extra context
This struct very definitely is constructed, as demonstrated by the deliberate crash.
Other cases
Rust Version
Anything else?
1.88.0 correctly omits this warning. I haven't bisected it.
The bug is still present in today's beta and nightly