-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Block expression "swallows" unused_must_use warning #104253
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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.
Given the following code: Playground
The current output is:
Ideally the output should look something like:
I've stumbled upon this with code that uses
unsafe. Sometimes you seeinstead of
which swallows the warning, as the block counts as a usage, even if the block itself is unused.
It would be nice if the block eval expression could "taint" the block itself, making it effectively
#[must_use]as well.