Closed
Description
When a type parameter shadows a type name in a pattern, E0574 should point at the type parameter and check if there are other types that could be resolved with the same name and point at them as well.
It currently is
error[E0574]: expected struct, variant or union type, found type parameter `Irrelevant`
--> src/lib.rs:10:13
|
10 | Irrelevant { irrelevant } => {
| ^^^^^^^^^^ not a struct, variant or union type
and should be
error[E0574]: expected struct, variant or union type, found type parameter `Irrelevant`
--> src/lib.rs:10:13
|
3 | pub struct Irrelevant<Irrelevant> {
| ---------- you might have meant to refer to this struct
...
7 | impl<Irrelevant: Debug> Debug for Irrelevant<Irrelevant> {
| ---------- found this type parameter
...
10 | Irrelevant { irrelevant } => {
| ^^^^^^^^^^ not a struct, variant or union type
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsDiagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Relevant to the compiler team, which will review and decide on the PR/issue.