Suggest similar keyword when visibility is not followed by an item#154561
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Apr 6, 2026
Merged
Conversation
Collaborator
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
Collaborator
|
r? @mati865 rustbot has assigned @mati865. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
Doesn't necessary when test is self-explanatory |
Member
|
@rustbot reroll |
TaKO8Ki
approved these changes
Apr 5, 2026
Member
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 5, 2026
…fter-visibility, r=TaKO8Ki Suggest similar keyword when visibility is not followed by an item Fixes rust-lang#153353. I would appreciate feedback on the following: - I inlined [`find_similar_kw`](https://github.com/rust-lang/rust/blob/cd14b73b4a41542d921f59e362a5b5005fa4f2ef/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!
rust-bors bot
pushed a commit
that referenced
this pull request
Apr 5, 2026
…uwer Rollup of 8 pull requests Successful merges: - #153440 (Various LTO cleanups) - #154561 (Suggest similar keyword when visibility is not followed by an item) - #154657 (Fix pattern assignment suggestions for uninitialized bindings) - #154717 (Fix ICE in unsafe binder discriminant helpers) - #154722 (fix(lints): Improve `ill_formed_attribute_input` with better help message) - #154808 (Post-attribute ports cleanup pt. 1) - #154849 (Promote `char::is_case_ignorable` from perma-unstable to unstable) - #154850 (ast_validation: scalable vectors okay for rustdoc)
rust-bors bot
pushed a commit
that referenced
this pull request
Apr 5, 2026
…uwer Rollup of 8 pull requests Successful merges: - #153440 (Various LTO cleanups) - #154561 (Suggest similar keyword when visibility is not followed by an item) - #154657 (Fix pattern assignment suggestions for uninitialized bindings) - #154717 (Fix ICE in unsafe binder discriminant helpers) - #154722 (fix(lints): Improve `ill_formed_attribute_input` with better help message) - #154808 (Post-attribute ports cleanup pt. 1) - #154849 (Promote `char::is_case_ignorable` from perma-unstable to unstable) - #154850 (ast_validation: scalable vectors okay for rustdoc)
rust-bors bot
pushed a commit
that referenced
this pull request
Apr 6, 2026
…uwer Rollup of 8 pull requests Successful merges: - #153440 (Various LTO cleanups) - #154561 (Suggest similar keyword when visibility is not followed by an item) - #154657 (Fix pattern assignment suggestions for uninitialized bindings) - #154717 (Fix ICE in unsafe binder discriminant helpers) - #154722 (fix(lints): Improve `ill_formed_attribute_input` with better help message) - #154808 (Post-attribute ports cleanup pt. 1) - #154849 (Promote `char::is_case_ignorable` from perma-unstable to unstable) - #154850 (ast_validation: scalable vectors okay for rustdoc)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 6, 2026
…fter-visibility, r=TaKO8Ki Suggest similar keyword when visibility is not followed by an item Fixes rust-lang#153353. I would appreciate feedback on the following: - I inlined [`find_similar_kw`](https://github.com/rust-lang/rust/blob/cd14b73b4a41542d921f59e362a5b5005fa4f2ef/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!
This was referenced Apr 6, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Apr 6, 2026
…uwer Rollup of 9 pull requests Successful merges: - #153440 (Various LTO cleanups) - #151899 (Constify fold, reduce and last for iterator) - #154561 (Suggest similar keyword when visibility is not followed by an item) - #154657 (Fix pattern assignment suggestions for uninitialized bindings) - #154717 (Fix ICE in unsafe binder discriminant helpers) - #154722 (fix(lints): Improve `ill_formed_attribute_input` with better help message) - #154777 (`#[cfg]`: suggest alternative `target_` name when the value does not match) - #154849 (Promote `char::is_case_ignorable` from perma-unstable to unstable) - #154850 (ast_validation: scalable vectors okay for rustdoc)
rust-timer
added a commit
that referenced
this pull request
Apr 6, 2026
Rollup merge of #154561 - FranciscoTGouveia:typo-detection-after-visibility, r=TaKO8Ki Suggest similar keyword when visibility is not followed by an item Fixes #153353. I would appreciate feedback on the following: - I inlined [`find_similar_kw`](https://github.com/rust-lang/rust/blob/cd14b73b4a41542d921f59e362a5b5005fa4f2ef/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!
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Apr 7, 2026
…uwer Rollup of 9 pull requests Successful merges: - rust-lang/rust#153440 (Various LTO cleanups) - rust-lang/rust#151899 (Constify fold, reduce and last for iterator) - rust-lang/rust#154561 (Suggest similar keyword when visibility is not followed by an item) - rust-lang/rust#154657 (Fix pattern assignment suggestions for uninitialized bindings) - rust-lang/rust#154717 (Fix ICE in unsafe binder discriminant helpers) - rust-lang/rust#154722 (fix(lints): Improve `ill_formed_attribute_input` with better help message) - rust-lang/rust#154777 (`#[cfg]`: suggest alternative `target_` name when the value does not match) - rust-lang/rust#154849 (Promote `char::is_case_ignorable` from perma-unstable to unstable) - rust-lang/rust#154850 (ast_validation: scalable vectors okay for rustdoc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #153353.
I would appreciate feedback on the following:
find_similar_kwinstead of changing its visibility topub(super). I am happy to switch if it is preferred;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!