about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/util/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-02-11Simplify intra-crate qualifiers.Nicholas Nethercote-4/+4
The following is a weird pattern for a file within `rustc_middle`: ``` use rustc_middle::aaa; use crate::bbb; ``` More sensible and standard would be this: ``` use crate::{aaa, bbb}; ``` I.e. we generally prefer using `crate::` to using a crate's own name. (Exceptions are things like in macros where `crate::` doesn't work because the macro is used in multiple crates.) This commit fixes a bunch of these weird qualifiers.
2025-01-31Overhaul `to_readable_str`.Nicholas Nethercote-1/+0
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.
2025-01-31Move `find_self_call`.Nicholas Nethercote-3/+0
It's a function that does stuff with MIR and yet it weirdly has its own module in `rustc_middle::util`. This commit moves it into `rustc_middle::mir`, a more sensible home.
2025-01-13Assert that Instance::try_resolve is only used on body-like thingsMichael Goulet-2/+0
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2023-09-22Merge `ExternProviders` into the general `Providers` structOli Scherer-0/+1
2023-09-22Have a single struct for queries and hookOli Scherer-0/+23
2023-04-16Move some utils out of `rustc_const_eval`Nilstrieb-0/+7
This allows us to get rid of the `rustc_const_eval->rustc_borrowck` dependency edge which was delaying the compilation of borrowck. The added utils in `rustc_middle` are small and should not affect compile times there.