mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-05 01:24:03 +00:00
Suggest similar keyword when visibility is not followed by an item
Fixes rust-lang/rust#153353.
I would appreciate feedback on the following:
- I inlined [`find_similar_kw`](cd14b73b4a/compiler/rustc_parse/src/parser/diagnostics.rs (L218-L224)) instead of changing its visibility to `pub(super)`. I am happy to switch if it is preferred;
- I didn't add a comment to the new test. Although the rustc-dev-guide specifies that a [comment should be added](https://rustc-dev-guide.rust-lang.org/tests/adding.html#comment-explaining-what-the-test-is-about) to every new test, this is not common in `tests/ui/parser/misspelled_keywords/` and the test seems self-explanatory. Let me know if you would like me to add a comment;
Thank you in advance for your time and input!