-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
dead_code lint highlights too much on functions with multi-line signatures #63064
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.C-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-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.C-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.
With the following example code:
(Playground)
The compiler produces these warnings:
Notice that for
fn unusedandfn unused2,dead_codeis reported on only the first line signature of the function, however forfn unused3dead_codeis reported on the whole function from start to finish.This is mostly annoying when writing new functions in an editor like vscode that rls will cause the whole function to be orange-wavy-underlined, making a huge distraction.