-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.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.
Description
In the process of writing some code, I didn't import an enum, resulting in
error[E0412]: cannot find type `AssignCommand` in this scope
--> parser/src/command.rs:61:48
|
61 | fn maybe_parse_review(&mut self) -> Option<AssignCommand<'a>> {
| ^^^^^^^^^^^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
1 | use crate::command::assign::AssignCommand;
|
help: you might be missing a type parameter
|
51 | impl<'a, AssignCommand> Input<'a> {
| ^^^^^^^^^^^^^^^
The import suggestion is great, but suggesting the type parameter seems likely to be confusing (and IMO, is almost certainly wrong). My suggested heuristic is to avoid suggesting the type parameter if we suggest a candidate in another module, at least, and possibly even avoid suggesting it always if there's more than on letter. It also seems suprising to suggest the type parameter on the impl and not the (more local) function?
I can try to come up with a MCVE, but I suspect it's pretty simple and I wanted to just not forget about this.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.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.