Detect inverted (type, parameter name) function parameters and suggest fix accordingly #54065
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
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:
as 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.The text was updated successfully, but these errors were encountered: