about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/thousands
AgeCommit message (Collapse)AuthorLines
2025-06-12Overhaul the `thousands` module.Nicholas Nethercote-16/+75
It currently only inserts separators into `usize`s, because that's all that has been needed so far. `-Zmacro-stats` will need `isize` and `f64` handling, so this commit adds that.
2025-01-31Overhaul `to_readable_str`.Nicholas Nethercote-0/+30
It's a function that prints numbers with underscores inserted for readability (e.g. "1_234_567"), used by `-Zmeta-stats` and `-Zinput-stats`. It's the only thing in `rustc_middle::util::common`, which is a bizarre location for it. This commit: - moves it to `rustc_data_structures`, a more logical crate for it; - puts it in a module `thousands`, like the similar crates.io crate; - renames it `format_with_underscores`, which is a clearer name; - rewrites it to be more concise; - slightly improves the testing.