Skip to content

tidy: handle large numeric sort keys#159273

Draft
kn1g78 wants to merge 1 commit into
rust-lang:mainfrom
kn1g78:tidy-handle-large-numeric-sorts
Draft

tidy: handle large numeric sort keys#159273
kn1g78 wants to merge 1 commit into
rust-lang:mainfrom
kn1g78:tidy-handle-large-numeric-sorts

Conversation

@kn1g78

@kn1g78 kn1g78 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tidy's alphabetical checker parsed numeric sort keys as u64, which panicked when a marked list contained a number larger than u64::MAX.

Compare numeric sequences by their leading-zero-trimmed length and lexical value instead. This preserves the existing natural ordering and supports arbitrarily long ASCII digit sequences.

Added a regression test for values above u64::MAX.

Tests:

  • cargo test --offline --manifest-path src/tools/tidy/Cargo.toml
  • x test tidy

@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants