-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Error is not the best with mistyping Struct instead of struct #97793
Comments
@TaKO8Ki while you're at it, we probably should 1) create a |
@estebank I'm interested in implementing a fix for this but I don't know what's a "concept string" in this context. Could you please explain more about it? |
I think Esteban meant, expanded:
That would not only catch |
Thank you for the detailed explanation. @rustbot claim |
Hi, I thought of a slightly better but more complicated approach. In case you have any suggestions: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Tracking.20Expected.20Keywords.20when.20Parsing/near/463517139 |
Rollup merge of rust-lang#129899 - veera-sivarajan:fix-97793-pr-final, r=chenyukang Add Suggestions for Misspelled Keywords Fixes rust-lang#97793 This PR detects misspelled keywords using two heuristics: 1. Lowercasing the unexpected identifier. 2. Using edit distance to find a keyword similar to the unexpected identifier. However, it does not detect each and every misspelled keyword to minimize false positives and ambiguities. More details about the implementation can be found in the comments.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=0c755cbfa505e42fb58dd902968675e5
The current output is:
Identical on stable and nightly (per playground).
It would be friendler to show some help about the proper casing of
struct
.The text was updated successfully, but these errors were encountered: