Error messages wrt. patterns named the same as a type could be better #49145
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
WG-diagnostics
Working group: Diagnostics
Given:
a rust compiler (playground, stable) will error with:
this is morally right; but the error message could highlight the fact that the user most likely confused the pattern
f
(as in the equivalent unit struct patternf {}
) with a variable bindingf
.Tho, the names coinciding is somewhat pathological, so it might not warrant special care; but perhaps it does?
The text was updated successfully, but these errors were encountered: