-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics
Description
Given:
struct f; fn main() { let f = 1; }a rust compiler (playground, stable) will error with:
error[E0308]: mismatched types
--> src/main.rs:1:27
|
1 | struct f; fn main() { let f = 1; }
| ^ expected integral variable, found struct `f`
|
= note: expected type `{integer}`
found type `f`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 pattern f {}) with a variable binding f.
Tho, the names coinciding is somewhat pathological, so it might not warrant special care; but perhaps it does?
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics