-
Notifications
You must be signed in to change notification settings - Fork 14k
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.
Description
Each time I switch from programming in (TypeScript, rust) to programming in (C, C++, C#) or vice versa, I end up inevitably writing function parameters backwards. To me, the following message is obviously more than enough:
error: expected one of `:` or `@`, found `path`
--> src/backup/mod.rs:113:36
|
113 | fn create_pipeline(&self, &str path) -> Result<Box<Write>> {
| ^^^^ expected one of `:` or `@` hereas it brings to my attention the inverted signature parameters. However, it occurs to me that this might be an easy (albeit extremely low priority) win to make the compiler emit friendlier error messages for newcomers to rust. Perhaps this can be detected an a message along the lines of "did you mean path: &str instead?" could be emitted here.
Patryk27
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.