-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Give a better diagnostic for keywords with incorrect capitalization #77149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is not just for fn main() {
Let x = "hello";
}
Perhaps in general it might be nice to do some kind of Levenshtein distance for identifiers that might be intended to be keywords? Might be tricky to implement though, and probably not necessary. @jyn514 Do you want to update the title since this would be nice to have for other keywords as well? |
While let
I think there is a lot for this, like |
If I didn't think it was worth it, I wouldn't have opened the issue. |
@camelid FYI I don't think newcomer-roadblock is wrong per-se, but I opened this because I made the typo myself and was very confused for a second 😆 |
I don't know; I would consider it newcomer-roadblock. This is a pretty confusing error:
In general, Rust's parse errors can sometimes be a bit confusing (for me at least). It would just be nice if they were more semantic errors, rather than what token the parser expected and what it got. I think that format is more understandable to compiler developers than to regular programmers ;) |
guys, I really wanna do a related task to the parser, if you give me a little information that which part of the parser I should work on, I can start working on it |
@hosseind75 I am also a bit now on this but my guess is that this is probably not a very easy task to begin with. Or maybe check in |
sure I will check, thanks |
@estebank sorry can you give me a little instructions about how to fix this issue😅? |
Triage: No change. |
Notice the capitalization (playground):
Instead it would be nice to say
The text was updated successfully, but these errors were encountered: