about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/lib.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-01-31 10:58:33 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-01-31 16:04:13 +1100
commit0c470910061c9ad379b1cbf8a74315bc1a9b3c74 (patch)
treea6471f70f5275d9b10414e544435b0cac74dcb69 /compiler/rustc_data_structures/src/lib.rs
parent4ced93ed35ca7c88d618286488a5cf960049de5c (diff)
downloadrust-0c470910061c9ad379b1cbf8a74315bc1a9b3c74.tar.gz
rust-0c470910061c9ad379b1cbf8a74315bc1a9b3c74.zip
Overhaul `to_readable_str`.
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.
Diffstat (limited to 'compiler/rustc_data_structures/src/lib.rs')
-rw-r--r--compiler/rustc_data_structures/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs
index 65d586124b3..6ef73debadd 100644
--- a/compiler/rustc_data_structures/src/lib.rs
+++ b/compiler/rustc_data_structures/src/lib.rs
@@ -76,6 +76,7 @@ pub mod sync;
 pub mod tagged_ptr;
 pub mod temp_dir;
 pub mod thinvec;
+pub mod thousands;
 pub mod transitive_relation;
 pub mod unhash;
 pub mod unord;