improve similar method names suggestions #94747
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=af286f54d571ef5e00cd728ea244b3aa
The current output is:
Ideally the output should look like:
To a human, the method name
is_empty
is much closer toempty
than tobs_xmpty
.However, the algorithm used by the compiler to suggest similar method names seems a little bit simplistic and fails to suggest anything when a naive programmer like me types
empty()
instead ofis_empty
. The programmer then has to open the documentation, and he does not like that ;)The text was updated successfully, but these errors were encountered: