-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Take doc(alias) into account when providing typo suggestions #83968
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
Not anymore? |
I think this issue should be closed. The solution has already been implemented.
in playground (https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a5d74dbaa80fd7833c2b937fc94f58fa)
|
@Badel2 @amab8901 this specific issue with
|
Mentoring instructions: change rust/compiler/rustc_hir_typeck/src/method/probe.rs Lines 1923 to 1938 in 9644684
doc(alias) , not just the names themselves.
|
This looks doable. @rustbot claim |
…suggestions, r=compiler-errors Consider doc(alias) when providing typo suggestions This means that ```rust impl Foo { #[doc(alias = "quux")] fn bar(&self) {} } fn main() { (Foo {}).quux(); } ``` will suggest `bar`. This currently uses the "there is a method with a similar name" help text, because the point where we choose and emit a suggestion is different from where we gather the suggestions. Changes have mainly been made to the latter. The selection code will now fall back to aliased candidates, but generally only if there is no candidate that matches based on the existing Levenshtein methodology. Fixes rust-lang#83968.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a5d74dbaa80fd7833c2b937fc94f58fa
The current output is:
Ideally the output should look like:
Searching for
length
will already bring uplen
in the docs: https://doc.rust-lang.org/std/?search=lengthIt would be nice if the CLI errors had feature parity.
Meta
rustc --version
: 1.51.0The text was updated successfully, but these errors were encountered: