Skip to content

Account for titlecase in casing lints - #155469

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

Account for titlecase in casing lints#155469
rust-bors[bot] merged 1 commit into
rust-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

@rustbotrustbot 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

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

@rustbotrustbot 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 threadcompiler/rustc_lint/src/nonstandard_style.rs Outdated
Comment threadcompiler/rustc_lint/src/nonstandard_style.rs
@petrochenkovpetrochenkov 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

Jules-Bertholet commented Apr 20, 2026

Copy link
Copy Markdown
ContributorAuthor

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

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.

@petrochenkovpetrochenkov 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

rust-borsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0dca307 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-borsrust-borsBot 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-borsBot 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-borsBot merged commit 4f4c1d5 into rust-lang:mainApr 23, 2026
11 checks passed
@rustbotrustbot 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
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rust-timer build 8847b78

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (8847b78): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary -4.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-4.9%[-7.7%, -2.0%]2
All ❌✅ (primary)--0

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.12s -> 490.094s (-0.01%)
Artifact size: 394.30 MiB -> 394.30 MiB (-0.00%)

flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
Rollup of 7 pull requests
Successful merges:
- rust-lang/rust#155469 (Account for titlecase in casing lints)
- rust-lang/rust#155644 (delegation: support self ty propagation for functions in free to trait reuse)
- rust-lang/rust#154957 (Fix ICE when const closure appears inside a non-const trait method)
- rust-lang/rust#155442 (Change keyword order for `impl` restrictions)
- rust-lang/rust#155561 (Use singular wording for single _ placeholders in type suggestions)
- rust-lang/rust#155637 (Fix E0191 suggestion for empty dyn trait args)
- rust-lang/rust#155661 (Remove `AttributeLintKind` variants - part 6)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`A-UnicodeArea: UnicodeS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

5 participants

@Jules-Bertholet@rustbot@petrochenkov@Mark-Simulacrum@rust-timer