-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Tighten up the edit-distance suggestions on resolve #2281
Comments
Some useful discussion about this: Mozilla-Student-Projects/Projects-Tracker#32 |
Address #2281 ``` -> % cat foo.rs fn foo() -> int { let bar = 10; bad } ``` ``` -> % rustc foo.rs foo.rs:4:4: 4:7 error: unresolved name: `bad`. Did you mean: `bar`? foo.rs:4 bad ^~~ error: aborting due to previous error ```
The current suggestion is limited to the local scope, and doesn't have an edit distance limit. Thus the following code:
...results in the strange (if not funny) message:
|
updated description to current state of affairs. |
The current algorithm yields some truly surprising results. For example, I had some code where I typed |
Impose a limit so that the typo suggester only shows reasonable suggestions (i.e. don't suggest `args` when the error is `foobar`). A tiny bit of progress on #2281.
Closing. I haven't seen any really strange suggestions (and in fact the suggestions were helpful). |
Rustup Fix our stacktrace after rust-lang#98549. Now we can control whether `caller_location` should be pruned!
Create a RFC for feature gate for APIs included in the Kani library. Tracking issue: rust-lang#2279 Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
less text for same effect
We currently have an edit-distance "did you mean $somethingelse" check in resolve if there's no match for an identifier. This does not limit the distance and is somewhat limited in where it looks. Fix these issues.
The text was updated successfully, but these errors were encountered: