-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Suggestion for adding a type parameter happens a little too often. #70365
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.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-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.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.
The following code now emits a suggestion to add a type parameter (since #68447 in 1.42):
Emits:
The suggestion to add
<PathBuf>is clearly wrong (in my eyes), and I feel like I am seeing this suggestion a lot.Perhaps, if there is already a "possible candidate import" suggestion, it could skip the suggestion to add a type parameter? Or maybe some other heuristic to dial back how often it shows up?
(BTW, it is a great suggestion when it applies, but more often than not I'm getting a wrong hint.)