-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Make the capitalization explicit on keyword misspell error #149427
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
Conversation
|
cc @Muscraft |
| | ^^^ | ||
| | | ||
| help: write it in the correct case (notice the capitalization) | ||
| help: write it in lowercase (notice the capitalization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the notice the capitalization bit is here because the misspelled keyword has letters that whose capitalization is hard to notice (for instance, u and U are similar, kinda).
i do think it's a good thing and it should be kept because it reinforces the fact that some extra attention is needed in order to spot the mistake.
|
|
||
| let case = match (is_upper, is_lower) { | ||
| (true, true) => { | ||
| unreachable!("keyword that is both fully upper- and fully lowercase") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This triggers on empty keywords. Though I'm not sure if that's possible, I guess not? We were getting rid of the empty identifier anyway so I don't think we need to worry about it.
|
@bors r+ rollup |
Rollup of 6 pull requests Successful merges: - #149393 (expand valid edition range for use-path-segment-kw.rs) - #149427 (Make the capitalization explicit on keyword misspell error) - #149433 (Use a delayed bug for this layout ICE) - #149473 (Tidying up UI tests [7/N]) - #149505 (Update the comment in the add_typo_suggestion function) - #149513 (`rust-analyzer` subtree update) r? `@ghost` `@rustbot` modify labels: rollup
r? @jdonszelmann
Will help for #149405.