Skip to content

Rollup of 9 pull requests - #166567

Merged
rust-bors[bot] merged 31 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-NKJyctB
Nov 25, 2026
Merged

rust-bors[bot] merged 31 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-NKJyctB

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

born-in-autumn and others added 30 commits November 6, 2026 18:02
`WakeByAddressSingle` doesn't report whether it woke anything, so
`futex_wake` is always false on Windows and `wake_writer_or_readers`
wakes a writer and the readers together. The writer usually loses.

Count the writers going to sleep on `writer_notify` and treat a non-zero
count as a wakeup that reached a writer.
We start with a fresh incr comp session dir, so an already existing file
would mean that there is a conflict between two files produced by the
same rustc instance.
crate_info.each_linked_rlib_file_for_lto is empty for thin local LTO and
by extension crate_info.exported_symbols_for_lto is adopted
appropriately. As such behavior should be unchanged.
This test switches the section with `.section` and never switches it
back.  The Reference says that assembly using a stateful directive
must undo the effect of the directive before the block ends (see
`asm.directives.stateful`).

In this case, nothing follows the block, so nothing is affected.  But
let's make the test follow the rule.
Most of this commit is moving code around and extracting some functions to make bb assignments clear and explicit.
Prepare for splitting tests. Done in a separate commit so git has an
easier time tracking these.
This crate currently takes a rather long time to build, 40s-1m, which
makes iteration difficult. Switch to the same pattern as std using
Cargo's test detection so this automatically gets split into more
crates.

The change cuts off about 50% of the cold build time on my machine, and
avoids needing to rebuild everything when a single test file is changed
(incremental unfortunately does not work great). `num` is the limiting
test, as it alone takes about 20s to build, but that could possibly be
split further in the future.

This change also caught that error.rs was not being run because it
wasn't listed as a test module.

`deny(unsafe_op_in_unsafe_fn)` is also removed as that is now implied by
the edition.

Zulip discussion: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Library.20tests.20build.20time/with/643081197
…nthey

core: Use autotests to split up coretests

This crate currently takes a rather long time to build, 40s-1m, which makes iteration difficult. Switch to the same pattern as std using Cargo's test detection so this automatically gets split into more crates.

The change cuts off about 50% of the cold build time on my machine, and avoids needing to rebuild everything when a single test file is changed (incremental unfortunately does not work great). `num` is the limiting test, as it alone takes about 20s to build, but that could possibly be split further in the future.

This change also caught that error.rs was not being run because it wasn't listed as a test module.

`deny(unsafe_op_in_unsafe_fn)` is also removed as that is now implied by the edition.

Zulip discussion: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Library.20tests.20build.20time/with/643081197
…nkov

Various incr comp session refactors

The first half of this PR is preparations for being able to create multiple incr comp sessions for a single crate. This will become important to store the post-ThinLTO incr comp artifacts once `-Zno-link`/`-Zlink-only` will run ThinLTO in a separate rustc session, thus requiring the main incr comp session to be finished before ThinLTO runs. The second half of this PR is a bunch of minor cleanups to `load_dep_graph`.

Part of rust-lang/compiler-team#908
…ers, r=joboet

Windows: Don't make RwLock writers race readers

Fixes rust-lang#165314

The futex `RwLock` is meant to prefer writers. rust-lang#95801 does that by waking a writer first and only waking readers if `futex_wake` says there was no writer to wake. `WakeByAddressSingle` doesn't report that, so on Windows `futex_wake` is always false and a writer and the readers are woken together to race, which is the thing rust-lang#95801 set out to avoid. The writer usually loses.

Just returning `true` doesn't work: `WRITERS_WAITING` can be stale, and then nothing ever wakes the readers. So this counts the writers going to sleep on `writer_notify`. If the count isn't zero, a writer still has to retry the lock. It'll either take it or find it held, and either way whoever unlocks will see `READERS_WAITING`.

The compare-exchange before `wake_writer` must be `Acquire`. With `Relaxed` it can see the unlock of a writer that has already left and still read the old count, which leaves the readers asleep for good. Miri finds this if you force the interleaving, and a litmus test of just this ordering on an Apple M4 saw the old count 718829 times in 2.9 billion runs with `Relaxed` and never in 2.8 billion with `Acquire`. It can't happen on x86, where the generated code is the same.

Before and after on a Ryzen 5 5600 with Windows 10. Locks are held for 20 us unless noted.

| | writes/s | Writer p99 | reads/s |
|---|---:|---:|---:|
| Program from the issue | 1000 -> 6410 | 4.5 ms -> 36 us | |
| 1 writer every 1 ms, 6 readers | x1.6 | 4 ms -> 47 us | +10% |
| 3 writers, 6 readers | x2.4 | 2 ms -> 77 us | -30% |
| 4 writers, 12 readers, 5 us holds | x31 | 24 ms -> 766 us | -79% |

The last row is the cost. Writers go first, as on Linux, so with that many of them the readers mostly wait, and total operations drop 73%. In a `HashMap` cache shared by 6-24 threads, with 0.1-10% writes, 0-20 us between operations and 0-20 us read holds, total throughput rose in 19 of these 54 configurations and fell in 3, by about a quarter in the two with 10% writes and nothing between operations. Reader p99 got more than 1.5x worse in 8, all but one with 10% writes. Typst doesn't contend on any `RwLock` while compiling, so it doesn't change.

`RwLock<T>` grows by 4 bytes unless `T` is aligned to 8. The uncontended paths are effectively unchanged. The queue-based `RwLock` is the obvious alternative and loses much less under heavy writes, but it makes uncontended reads 32% slower.

Tested with `./x test library/std` and Miri on x86_64 only. FreeBSD, DragonFly and Fuchsia have the same `futex_wake` behavior and are left as they are. Adding them to the `cfg_select!` opts them in.
…ations-terminology, r=BoxyUwU

feat: rename region obligations

**For Context**: rust-lang/project-assumptions-on-binders#42

As mentioned in the issue, there are quite a few places in the repo with a variable called(or included) `region_obligations`, but they're neither regions(they're types) nor obligations(more likely a result). This is confusing and misleading, and this PR addresses it.

**Changelog**:
While reading the code, I found that there were already a few naming-related changes about some time ago. The most obvious one is this [line](https://github.com/rust-lang/rust/blob/249c1e4e31111b54ad2483cfd4cea06c7020c653/compiler/rustc_infer/src/infer/mod.rs#L149):
```rust
region_obligations: Vec<TypeOutlivesConstraint<'tcx>>
```
which perfectly matches the issue's description. I reanmeed it to `type_outlives_constraints `, and using that as an achor, rename all the related related occurrences (thanks to rust-analyzer and grep).

[One special case](https://github.com/rust-lang/rust/blob/249c1e4e31111b54ad2483cfd4cea06c7020c653/compiler/rustc_infer/src/infer/outlives/obligations.rs#L347) is `process_registered_region_obligations`, which involves both `region obligations` and `type outlives constraints`, **but in the near future we will remove the region outlives constraints**, so rename it `process_registered_type_outlives_constraints` directly will be better.

Also, a purely mechanical replacement would miss quite a few places. For each change, i paid attention to params, return values, other local variables, and comments. That said, i can't claim i've renamed everything exhaustively. Still, i think this PR will greatly improve this situation :)

I'm happy to make change if there are any issues.

Thanks for your reivew!
… r=ZuseZ4

Offload: generic kernels in a lib

This solves one of the blockers for using generic offload kernels (tracking issue rust-lang#131513) defined in a library. It uses the same logic for codegen in the device as for generics in normal compilations. The first commit also improves the ICE when an unknown symbol is read from the offload manifest, which has happened a lot while improving multi-crate support.

With this, it's possible to call kernels from dependencies. The test shows that the kernels are generated in the appropriate device compilations. I verified the test failing before the patch. My local tests also include linking by running on my cargo fork with offload support and it links and runs correctly.

There are still limitations. The most notable is that crate loading isn't propagated from host to device, which is the reason for the `extern crate` in the test. It will be fixed in a follow up [if we can converge on a design](https://rust-lang.zulipchat.com/#narrow/channel/422870-t-compiler.2Fgpgpu-backend/topic/offload.3A.20loading.20crates.20in.20the.20device.20pass/with/640253806)

Another one is that it's impossible to call the kernels from a lib. I'm working on this, but it's fairly independent and I will make it as a follow up.

@rustbot label +F-gpu_offload

r? @ZuseZ4
…global-target-feature, r=Amanieu

Restore the section in `global-target-feature.rs`

This test switches the section with `.section` and never switches it back.  The Reference says that assembly using a stateful directive must undo the effect of the directive before the block ends (see `asm.directives.stateful`).

In this case, nothing follows the block, so nothing is affected.  But let's make the test follow the rule.

r? @Amanieu
…utine-drop, r=oli-obk

avoid Terminator:None in coroutine drop shim building

Another step towards changing `Option<Terminator>` to `Terminator` in `BasicBlockData`. More info in [this thread](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/vibe.20check.20-.20removing.20Option.20from.20Terminator/with/637588808).

Most of this is moving some code around to make basic block id assumption happen right next to the list creation.
…caping-regions, r=nnethercote

perf: remove cache in `FoldEscapingRegions`
This was referenced Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 42e0b13 (parent) -> 6c709eb (this PR)

Test differences

Show 12315 test diffs

Stage 1

  • adapters::flatten::test_iterator_flatten_fold: [missing] -> pass (J0)
  • adapters::take_while::test_iterator_take_while: [missing] -> pass (J0)
  • adapters::zip::test_zip_nth_side_effects: [missing] -> pass (J0)
  • any_downcast_ref: [missing] -> pass (J0)
  • bool::test_bool_to_result: pass -> [missing] (J0)
  • builders::debug_map::test_invalid_finish_incomplete_entry: [missing] -> pass (J0)
  • carryless_mul::carryless_mul_u8: [missing] -> pass (J0)
  • cast::test_bounded_cast_u128_to_i128: [missing] -> pass (J0)
  • cast::test_bounded_cast_u8_to_i64: [missing] -> pass (J0)
  • cast::test_bounded_cast_u8_to_u16: [missing] -> pass (J0)
  • cast::test_checked_cast_isize_to_i128: [missing] -> pass (J0)
  • cell::ref_and_refmut_have_sensible_show: pass -> [missing] (J0)
  • floats::clamp_min_is_nan::test_f64: [missing] -> pass (J0)
  • floats::floor::const_::test_f64: [missing] -> pass (J0)
  • floats::floor::test_f64: [missing] -> pass (J0)
  • floats::midpoint::test_f16: [missing] -> pass (J0)
  • floats::midpoint::test_f64: [missing] -> pass (J0)
  • floats::mul_add::test_f128: [missing] -> pass (J0)
  • floats::round_ties_even::test_f32: [missing] -> pass (J0)
  • fmt::builders::debug_map::test_multiple_and_non_exhaustive: pass -> [missing] (J0)
  • fmt::builders::debug_struct::test_empty: pass -> [missing] (J0)
  • int_sqrt::i8::isqrt: [missing] -> pass (J0)
  • int_xor: [missing] -> pass (J0)
  • iter::adapters::intersperse::test_non_fused_iterator_intersperse: pass -> [missing] (J0)
  • num::cast::test_bounded_cast_u64_to_u128: pass -> [missing] (J0)
  • num::cast::test_checked_cast_i128_to_i128: pass -> [missing] (J0)
  • num::cast::test_checked_cast_u64_to_i64: pass -> [missing] (J0)
  • num::cast::test_checked_cast_usize_to_u8: pass -> [missing] (J0)
  • num::floats::ceil::const_::test_f16: pass -> [missing] (J0)
  • num::floats::neg_infinity::const_::test_f32: pass -> [missing] (J0)
  • num::i128::test_rem_euclid: pass -> [missing] (J0)
  • num::i16::test_pow: pass -> [missing] (J0)
  • num::i32::test_be: pass -> [missing] (J0)
  • num::i64::test_midpoint: pass -> [missing] (J0)
  • num::i8::test_abs: pass -> [missing] (J0)
  • num::nonzero::nonzero_leading_zeros: pass -> [missing] (J0)
  • num::ops::test_add_defined: pass -> [missing] (J0)
  • num::test_try_u128bool: pass -> [missing] (J0)
  • num::u32::test_div_floor: pass -> [missing] (J0)
  • num::u64::test_carrying_mul: pass -> [missing] (J0)
  • num::wrapping::test_wrapping_i128: pass -> [missing] (J0)
  • slice::brute_force_rotate_test_1: pass -> [missing] (J0)
  • slice::memchr::matches_one: pass -> [missing] (J0)
  • slice::test_chunks_exact_last: pass -> [missing] (J0)
  • slice::test_rchunks_count: pass -> [missing] (J0)
  • sources::test_repeat_with: [missing] -> pass (J0)
  • static_init: [missing] -> pass (J0)
  • test_collect: [missing] -> pass (J0)
  • test_rchunks_exact_mut_nth_back: [missing] -> pass (J0)
  • test_try_i32u16: [missing] -> pass (J0)
  • thin_box: [missing] -> pass (J0)
  • time::checked_add: pass -> [missing] (J0)
  • time::div: pass -> [missing] (J0)
  • adapters::map_windows::drop_checks::no_iter_panic_n5: [missing] -> pass (J2)

Stage 2

  • adapters::chain::test_iterator_chain_last: [missing] -> pass (J1)
  • adapters::map_windows::drop_checks::panic_in_middle: [missing] -> pass (J1)
  • adapters::map_windows::test_too_large_array_size: [missing] -> pass (J1)
  • cast::test_bounded_cast_i32_to_u16: [missing] -> pass (J1)
  • cast::test_bounded_cast_i64_to_u32: [missing] -> pass (J1)
  • cast::test_bounded_cast_u16_to_u16: [missing] -> pass (J1)
  • cast::test_bounded_cast_u16_to_u8: [missing] -> pass (J1)
  • floats::is_normal::const_::test_f32: [missing] -> pass (J1)
  • floats::log::test_f64: [missing] -> pass (J1)
  • floats::midpoint::const_::test_f128: [missing] -> pass (J1)
  • floats::neg_zero::test_f64: [missing] -> pass (J1)
  • floats::signum::const_::test_f16: [missing] -> pass (J1)
  • fmt::builders::debug_set::test_empty: pass -> [missing] (J1)
  • io::io_slice::io_slice_mut_advance_slices: pass -> [missing] (J1)
  • nonzero::uint::u16::test_strict_mul: [missing] -> pass (J1)
  • num::cast::test_bounded_cast_i32_to_u32: pass -> [missing] (J1)
  • num::cast::test_bounded_cast_u8_to_usize: pass -> [missing] (J1)
  • num::cast::test_checked_cast_i128_to_i128: pass -> [missing] (J1)
  • num::cast::test_checked_cast_u128_to_isize: pass -> [missing] (J1)
  • num::dec2flt::decimal::check_fast_path_f64: pass -> [missing] (J1)
  • num::dec2flt::fast_path_correct: pass -> [missing] (J1)
  • num::dec2flt::float::test_f32_consts: pass -> [missing] (J1)
  • num::dec2flt::parse::issue31407: pass -> [missing] (J1)
  • num::i128::test_carrying_add: pass -> [missing] (J1)
  • num::i32::test_next_multiple_of: pass -> [missing] (J1)
  • num::test_i16i32: pass -> [missing] (J1)
  • num::test_leading_plus: pass -> [missing] (J1)
  • num::test_try_isizeusize: pass -> [missing] (J1)
  • num::test_try_u128isize: pass -> [missing] (J1)
  • num::u16::test_is_next_multiple_of: pass -> [missing] (J1)
  • ops::test_mul_defined: [missing] -> pass (J1)
  • ptr::align_offset_zst: pass -> [missing] (J1)
  • slice::test_align_to_simple: pass -> [missing] (J1)
  • slice::test_rchunks_exact_last: pass -> [missing] (J1)
  • slice_index::rangefrom_len::pass: [missing] -> pass (J1)
  • swap_panics::index_a_equals_len: [missing] -> pass (J1)
  • test_max_min_signedness: [missing] -> pass (J1)
  • test_rotate_left: [missing] -> pass (J1)
  • test_try_i64i32: [missing] -> pass (J1)
  • test_try_u16bool: [missing] -> pass (J1)
  • test_try_u64u128: [missing] -> pass (J1)
  • test_try_u64u64: [missing] -> pass (J1)
  • u8::test_bit_width: [missing] -> pass (J1)
  • unzip_options: [missing] -> pass (J1)
  • num::floats::round::test_f16: pass -> [missing] (J3)
  • num::int_sqrt::i128::isqrt_extended: pass -> [missing] (J4)

(and 12196 additional test diffs)

Additionally, 19 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 6c709eb428d472a3c3d93681c1ba37d44a1c27cf --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-x86_64-gnu-parallel-frontend: 1h 24m -> 2h 11m (+56.4%)
  2. dist-armhf-linux: 1h 5m -> 1h 34m (+42.8%)
  3. dist-x86_64-netbsd: 1h 7m -> 1h 35m (+42.6%)
  4. test-x86_64-msvc-ext2: 1h 10m -> 1h 41m (+42.5%)
  5. test-x86_64-rust-for-linux: 44m 43s -> 1h 3m (+41.9%)
  6. test-i686-msvc: 1h 48m -> 2h 28m (+37.1%)
  7. test-x86_64-gnu-gcc-core-tests: 13m 51s -> 18m 54s (+36.5%)
  8. test-i686-gnu-nopt-2: 2h 22m -> 1h 30m (-36.1%)
  9. test-x86_64-gnu-stdlib-semver-check: 12m 49s -> 17m 25s (+35.9%)
  10. test-x86_64-gnu-stable: 2h 40m -> 1h 43m (-35.5%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (6c709eb): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary -5.2%, secondary -3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
-5.2% [-15.2%, -0.7%] 31
Improvements ✅
(secondary)
-3.9% [-8.2%, -1.1%] 14
All ❌✅ (primary) -5.2% [-15.2%, -0.7%] 31

Cycles

Results (primary -3.4%, secondary 2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-3.4% [-3.4%, -3.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.4% [-3.4%, -3.4%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 459.97s -> 460.462s (0.11%)
Artifact size: 405.61 MiB -> 405.59 MiB (-0.01%)

@rust-bors

rust-bors Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#166487 core: Use autotests to split up coretests ce190ac291959fa61614fa20d4d6c00d69585211
(link)
#165145 Various incr comp session refactors 8ecad04b96951c061be003ea44d5eb29f2a2fb9d
(link)
#165337 Windows: Don't make RwLock writers race readers 7c1130b1b95f0d36afb84714fbf63e0e98592448
(link)
#165732 feat: rename region obligations d7cfaab03a78207716fdeb3235d2265dbb3206c4
(link)
#166061 Offload: generic kernels in a lib ad507fc053a9bff416d2e052d5b672194ac6c84a
(link)
#166539 Restore the section in global-target-feature.rs 4d0bdb2e55d110fce479c6d5d705aa384b18b771
(link)
#165721 avoid Terminator:None in coroutine drop shim building 8783588b8ec163f75e70ba13e7fbbad2c9d591f1
(link)
#166453 perf: remove cache in FoldEscapingRegions ef11593c7169152042b6ceb5330ab32b3e5c5a36
(link)
#166547 Pin i686 msvc e95c66b3995a5f8f6a5fe04b43067553a127eaeb
(link)

parent commit: 42e0b13fb7

In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: @rust-timer triage $SHA $SHA $SHA..., or run @rust-timer triage all to benchmark all rollup members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.