Skip to content

Conversation

@scrabsha
Copy link
Contributor

r? @jdonszelmann

Will help for #149405.

@rustbot
Copy link
Collaborator

rustbot commented Nov 28, 2025

rustc_errors::emitter was changed

cc @Muscraft

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 28, 2025
| ^^^
|
help: write it in the correct case (notice the capitalization)
help: write it in lowercase (notice the capitalization)
Copy link
Contributor Author

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")
Copy link
Contributor

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.

@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 1, 2025

📌 Commit 85e24b0 has been approved by jdonszelmann

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 1, 2025
bors added a commit that referenced this pull request Dec 1, 2025
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
@bors bors merged commit 14da32f into rust-lang:main Dec 1, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Dec 1, 2025
rust-timer added a commit that referenced this pull request Dec 1, 2025
Rollup merge of #149427 - scrabsha:push-rxkwyumxrrtu, r=jdonszelmann

Make the capitalization explicit on keyword misspell error

Will help for #149405.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants