Skip to content

Account for titlecase in casing lints#155469

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Jules-Bertholet:titlecase-idents
Apr 23, 2026
Merged

Account for titlecase in casing lints#155469
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Jules-Bertholet:titlecase-idents

Conversation

@Jules-Bertholet
Copy link
Copy Markdown
Contributor

Puts #153892 to work.

Also contains fixes for Greek final sigma casing.

There are probably still some edge cases left to fix. Ideally we would use https://www.unicode.org/reports/tr55/#Identifier-Chunks as a base.

@rustbot label A-Unicode A-diagnostics A-lints A-suggestion-diagnostics

@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 Apr 18, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 18, 2026

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 72 candidates
  • Random selection from 18 candidates

@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` A-Unicode Area: Unicode labels Apr 18, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

What does titlecase mean in context of our lints?
I see some uses of uppercase are changed to titlecase, and some are left.
When is uppercase still supposed to be used in context of our lints?

Comment thread compiler/rustc_lint/src/nonstandard_style.rs Outdated
Comment thread compiler/rustc_lint/src/nonstandard_style.rs
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2026
@Jules-Bertholet
Copy link
Copy Markdown
Contributor Author

Jules-Bertholet commented Apr 20, 2026

The short answer is that ALL_CAPS_SNAKE_CASE items (e.g. consts and statics) should be all in uppercase (behavior unchanged from before); CamelCase items should use titlecase to start words (instead of uppercase, changed by this PR) and lowercase after (unchanged from before).

As for what this means in practice, the to_titlecase() and is_titlecase() docs explain the difference in detail.

@rust-bors

This comment has been minimized.

@petrochenkov
Copy link
Copy Markdown
Contributor

The short answer is that ALL_CAPS_SNAKE_CASE items (e.g. consts and statics) should be all in uppercase (behavior unchanged from before); CamelCase items should use titlecase to start words (instead of uppercase, changed by this PR) and lowercase after (unchanged from before).

Thanks, that's what I wanted to see.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 23, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 23, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 23, 2026

📌 Commit 0dca307 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Apr 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 23, 2026
Rollup of 7 pull requests

Successful merges:

 - #155469 (Account for titlecase in casing lints)
 - #155644 (delegation: support self ty propagation for functions in free to trait reuse)
 - #154957 (Fix ICE when const closure appears inside a non-const trait method)
 - #155442 (Change keyword order for `impl` restrictions)
 - #155561 (Use singular wording for single _ placeholders in type suggestions)
 - #155637 (Fix E0191 suggestion for empty dyn trait args)
 - #155661 (Remove `AttributeLintKind` variants - part 6)
@rust-bors rust-bors Bot merged commit 4f4c1d5 into rust-lang:main Apr 23, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 23, 2026
rust-timer added a commit that referenced this pull request Apr 23, 2026
Rollup merge of #155469 - Jules-Bertholet:titlecase-idents, r=petrochenkov

Account for titlecase in casing lints

Puts #153892 to work.

Also contains fixes for Greek final sigma casing.

There are probably still some edge cases left to fix. Ideally we would use https://www.unicode.org/reports/tr55/#Identifier-Chunks as a base.

@rustbot label A-Unicode A-diagnostics A-lints A-suggestion-diagnostics
@Jules-Bertholet Jules-Bertholet deleted the titlecase-idents branch April 23, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-diagnostics Area: Messages for errors, warnings, and lints A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` A-Unicode Area: Unicode 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.

3 participants