Move stuff around on `stable_mir` and `rustc_smir` crate
1. Break down rustc_smir/mod.rs file.
- This file was getting too big and causing a lot of merge conflicts.
All these changes shouldn't be visible to users since this module is private.
2. Move the compiler interface defs to its own module
- Separate items that are exposed in the `stable_mir` crate to be used
by the compiler from items that we expect to be used by tool developers.
Relate Inherent Associated Types using eq
We should call `eq` instead of `sup` as we're relating `Ty` directly and not `Binder<TraitRef>`.
This is part of #118118 but unrelated to that PR.
r? `@compiler-errors` `@lcnr`
Move EagerResolution to rustc_infer::infer::resolve
`EagerResolver` fits better in `rustc_infer::infer::resolver`.
Started to disentagle #118118 that has a lot of unrelated things.
r? `@compiler-errors` `@lcnr`
Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)`
Requested by `@fmease` in https://github.com/rust-lang/rust/pull/118226#pullrequestreview-1747432292.
There is also a much larger number of `option.map_or(false, cond)` that can be changed separately if someone wants.
r? fmease
general improvements/fixes on bootstrap
- adds #117813 into change tracker 6d9b92f83f
- fixes a bug in change tracker 63a4410952
- relocates `CONFIG_CHANGE_HISTORY` a7dcb984f6
Make PlaceholderReplacer shallow_resolver and recur when infer vars
This makes resolve type and const infer vars resolve.
Given:
```rust
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
struct Foo<T>(T);
impl<'a> Foo<fn(&'a ())> {
type Assoc = &'a ();
}
fn bar(_: for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)) {}
fn main() {}
```
We should normalize `for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)` to `for<'0> fn(&'1 ())` with `'1 == '0` and `'0 == 'static` constraints. We have to resolve `'1` to `'static` in the infcx associated to `PlaceholderReplacer`.
This is part of https://github.com/rust-lang/rust/pull/118118 but unrelated to that PR.
r? `@compiler-errors` `@lcnr`
This removes the check to ensure that `rustfix` between
* src/tools/cargo
* src/tools/compiletest
has the same version,
since `rust-lang/rustfix` has migrated to under `rust-lang/cargo`.
Optimize QueryArena allocation
This shifts the WorkerLocal wrapper to be outside the QueryArena, meaning that instead of having each query allocate distinct arenas per-worker we allocate the full set of arenas per-worker. This is primarily a code size optimization (locally, ~85 kilobytes, [perf is reporting >100 kilobytes](https://perf.rust-lang.org/compare.html?start=1fd418f92ed13db88a21865ba5d909abcf16b6cc&end=884c95a3f1fe8d28630ec3cdb0c8f95b2e539fde&stat=instructions%3Au&tab=artifact-size)), saving a bunch of code in the initialization of the arenas which was previously duplicated lots of times (per arena type).
Additionally this tells LLVM that the thread count can't be zero in this code (I believe this is true?) which shaves some small amount of bytes off as well since we eliminate checks for zero in the vec allocations.
`BcbBranch` represented an out-edge of a coverage graph node, but would
silently refer to a node instead in cases where that node only had one in-edge.
Instead we now refer to a graph edge as a `(from_bcb, to_bcb)` pair, or
sometimes as just one of those nodes when the other node is implied by the
surrounding context. The case of sole in-edges is handled by special code added
directly to `get_or_make_edge_counter_operand`.
This was previously a helper method in `MakeBcbCounters`, but putting it in the
graph lets us call it from `BcbBranch`, and gives us a more fine-grained
borrow.
In some cases we need to prepare a coverage expression that is the sum of an
arbitrary number of other terms. This patch simplifies the code paths that
build those sums.
This causes some churn in the mappings, because the previous code was building
its sums in a somewhat idiosyncratic order.
Now that this code path unconditionally calls `make_branch_counters`, we might
as well make that method responsible for creating the node's counter as well,
since it needs the resulting term anyway.
Fixes error count display is different when there's only one error left
Supersedes #114759
### What did I do?
I did the small change in `rustc_errors` by hand. Then I did the other changes in `/compiler` by hand, those were just find replace on `*.rs` in the workspace. The changes in run-make are find replace for `run-make` in the workspace.
All other changes are blessed using `x test TEST --bless`. I blessed the tests that were blessed in #114759.
### how to review this nightmare
ping bors with an `r+`. You should check that my logic is sound and maybe quickly scroll through the diff, but fully verifying it seems fairly hard to impossible. I did my best to do this correctly.
Thank you `@adrianEffe` for bringing this up and your initial implementation.
cc `@flip1995,` you said you want to do a subtree sync asap
cc `@RalfJung` maybe you want to do a quick subtree sync afterwards as well for Miri
r? `@WaffleLapkin`