Skip to content

Rollup of 10 pull requests - #162920

Merged
rust-bors[bot] merged 35 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rnSnu16
Sep 18, 2026
Merged

rust-bors[bot] merged 35 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rnSnu16

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

TechnoPorg and others added 30 commits September 9, 2026 15:36
LLVM 24 has moved from TargetOptions::ThreadModel to specifying
thread-model as a module flag. This catches us up.
This copy will retain and is specialized for blocking operations.
Incr comp only uses the non-blocking variant.
This lock registry allows emulating fd based locks (like flock()) on top
of the fcntl(F_SETLK) process based locks, thereby ensuring that
concurrent rustc instances inside the same process don't break the incr
comp locking scheme.
Borrow checking produces some weird, spanless help messages about fixing
lifetime errors. If there are multiple, they are grouped under a header
like this:
```
help: the following changes may resolve your lifetime errors
```
There are three forms of these. One of the forms is this:
```
  = help: add bound `'a: 'b`
```
This form is redundant, because there is always an earlier help note (on
a proper error message with a span) like this:
```
  = help: consider adding the following bound: `'b: 'a`
```

This commit removes these redundant messages.
…ostic

It's currently a spanless top-level help diagnostic. This commit changes
it to an error (with one or more help subdiagnostics), gives it a span,
and changes the wording.

Note that giving it a span means that deduplication will no longer
erroneously hide diagnostics with identical wording from different
functions! Because of this, several "duplicate diagnostic" mentions are
removed from the expected outputs.

It's still a weird diagnostic (and now counts towards the error count)
but it's better than before.

This also removes the one use of buffered non-error diagnostics. So
`BufferedDiag` is also removed.
And remove `struct_help`, to discourage use of `Level::Help`.
(`Sublevel::Help` is fine.)
If `fmaf16` is exported, the existing version hits errors like:

    error: `compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `core::fmt::num::<impl core::fmt::Debug for u64>::fmt` to `core::fmt::num::imp::<impl core::fmt::Display for u64>::fmt`
       --> library/core/src/fmt/num.rs:85:17
        |
     79 | / macro_rules! impl_Debug {
     80 | |     ($($T:ident)*) => {
     81 | |         $(
     82 | |             #[stable(feature = "rust1", since = "1.0.0")]
    ...   |
     85 | |                 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        | |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...   |
     96 | |     };
     97 | | }
        | |_- in this expansion of `impl_Debug!`
    ...
    595 | / impl_Debug! {
    596 | |     i8 i16 i32 i64 i128 isize
    597 | |     u8 u16 u32 u64 u128 usize
    598 | | }
        | |_- in this macro invocation

Presumably this comes from the call to `panicking::assert_failed!` that
needs to be monomorphized. Avoid any formatting by using a plain
`debug_assert!` if we are building the crate as compiler-builtins.
LLVM doesn't currently emit this but probably should, and this is
valuable as a fallback in any case.
…etrees

fix `is_single_fp_element` for `s390x` and `x86`

In rust-lang#161950 (comment) we discovered that the old `is_single_fp_element` is incorrect in a number of ways.

- it did not consider `f16` or `f128`
- it did not consider transparent wrappers
- on x86, it incorrectly accepted over-aligned types
- on s390x, it incorrectly accepted single-element unions and arrays

So, in practice each target does something slightly different here, and I've split the function into two.

cc @beetrees
…or, r=bjorn3

Replace hard linked `metadata.rmeta` with a copy when finalizing the incremental compilation session dir fails

Fixes rust-lang#151181.

Since 1.90.0, on ReFS (Windows Dev Drive) volumes finalizing the incremental compilation session directory would fail with `Access is denied. (os error 5)`. The issue was caused by rust-lang#114669, which meant that `metadata.rmeta` inside the session dir was a hard link to a file that was potentially being used by several other processes and ReFS seemingly refuses to rename such directories.  As a fallback, we try to replace the hard linked metadata file with a copy instead, so that the rename can succeed.

I don't think adding a test for this is possible due to the lack of a ReFS runner but I added a unit test for the `replace_hard_link_with_copy` helper.

r? @bjorn3
…beetrees

RISC-V: Add Zmmul target feature

Zmmul is a ratified subset of the M extension that only supports multiplication, but not division ([spec](https://docs.riscv.org/reference/isa/v20260120/unpriv/m-st-ext.html#11-1-3-zmmul-extension-version-1-0)). LLVM already supports the extension under the same name, so until rust-lang#162235 I'd just been using it directly.

There are two things I would particularly appreciate input on:

- Should M imply Zmmul?
  - From the [Machine-Level ISA spec](https://docs.riscv.org/reference/isa/v20260120/priv/machine.html) and [this discussion](riscv/riscv-isa-manual#869) in the RISC-V ISA Manual repo, it seems that Zmmul means all multiplication instructions are always supported, whereas M means they're only supported if the M bit is set in the `misa` register.
  - On the other hand, LLVM has M imply Zmmul ([RISCVFeatures.td](https://github.com/llvm/llvm-project/blob/f6f71edb4346d586bb97485116175efd9a696ee8/llvm/lib/Target/RISCV/RISCVFeatures.td#L214-L229)), so it feels nice to match that.
- How might I go about stabilizing this?
  - Can it be done right away?
  - Should it wait a few releases?
  - Is it better to batch it with the stabilization of other RISC-V target features, similarly to how it was done in rust-lang#145948?

No LLMs were used in the making of this PR, and all mistakes are those of a first-time rustc contributor.
…-obk

Ensure concurrent rustc instances in the same process correctly lock the session dir

This introduces a global lock registry for the `fcntl` lock fallback to allow emulating fd based locks (like `flock()`) on top of the `fcntl(F_SETLK)` process based locks, thereby ensuring that concurrent rustc instances inside the same process don't break the incr comp locking scheme.

Based on rust-lang#162584
Remove one remaining use of `Level::Help`

Unfortunately we can't yet get rid of `Level::Help` entirely because of `proc_macro::Help`. Details in individual commits.

r? @estebank
@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Sep 17, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-gnu-llvm-21-3,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu

@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 95edc20 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
Rollup of 10 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-gnu-llvm-21-3
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
@rust-bors

This comment has been minimized.

@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors p=1

@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6233a07 (6233a078e0f0b9728185ebb035cddc52fef17ca1)
Base parent: 76af58f (76af58f665c5cd76672e64ca118efbb0101fb224)

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 18, 2026
@rust-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 30m 8s
Pushing 50d5409 to main...

@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 ed30c2c (parent) -> 50d5409 (this PR)

Test differences

Show 37 test diffs

Stage 0

  • persist::fs::tests::test_replace_hard_link_with_copy_unshares_hard_link: [missing] -> pass (J3)

Stage 1

  • persist::fs::tests::test_replace_hard_link_with_copy_unshares_hard_link: [missing] -> pass (J1)
  • [ui] tests/ui/abi/compatibility.rs#aarch64-win: [missing] -> pass (J2)
  • [ui] tests/ui/abi/compatibility.rs#i686-reg-struct-return: [missing] -> pass (J2)
  • [ui] tests/ui/abi/compatibility.rs#i686-win: [missing] -> pass (J2)
  • [ui] tests/ui/abi/compatibility.rs#i686-win-gnu: [missing] -> pass (J2)
  • [ui] tests/ui/abi/compatibility.rs#x86-64-win-gnu: [missing] -> pass (J2)
  • [ui] tests/ui/derives/generated-derive-suggestion-issue-148207.rs#generated: [missing] -> pass (J2)
  • [ui] tests/ui/derives/generated-derive-suggestion-issue-148207.rs#source: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/abi/compatibility.rs#aarch64-win: [missing] -> pass (J6)
  • [ui (polonius)] tests/ui/abi/compatibility.rs#i686-reg-struct-return: [missing] -> pass (J6)
  • [ui (polonius)] tests/ui/abi/compatibility.rs#i686-win: [missing] -> pass (J6)
  • [ui (polonius)] tests/ui/abi/compatibility.rs#i686-win-gnu: [missing] -> pass (J6)
  • [ui (polonius)] tests/ui/abi/compatibility.rs#x86-64-win-gnu: [missing] -> pass (J6)
  • [ui (polonius)] tests/ui/derives/generated-derive-suggestion-issue-148207.rs#generated: [missing] -> pass (J6)
  • [ui (polonius)] tests/ui/derives/generated-derive-suggestion-issue-148207.rs#source: [missing] -> pass (J6)
  • [codegen] tests/codegen-llvm/s390x-abi/single-fp-element.rs: [missing] -> pass (J8)
  • [codegen] tests/codegen-llvm/x86-abi/single-fp-element.rs#linux: [missing] -> pass (J8)
  • [codegen] tests/codegen-llvm/x86-abi/single-fp-element.rs#win: [missing] -> pass (J8)

Stage 2

  • [ui] tests/ui/derives/generated-derive-suggestion-issue-148207.rs#generated: [missing] -> pass (J0)
  • [ui] tests/ui/derives/generated-derive-suggestion-issue-148207.rs#source: [missing] -> pass (J0)
  • [ui] tests/ui/sanitizer/cfi/invalid-attr-encoding.rs: ignore (ignored on targets without CFI sanitizer) -> pass (J4)
  • [codegen] tests/codegen-llvm/s390x-abi/single-fp-element.rs: [missing] -> pass (J5)
  • [codegen] tests/codegen-llvm/x86-abi/single-fp-element.rs#linux: [missing] -> pass (J5)
  • [codegen] tests/codegen-llvm/x86-abi/single-fp-element.rs#win: [missing] -> pass (J5)
  • [ui] tests/ui/abi/compatibility.rs#aarch64-win: [missing] -> ignore (gcc backend is marked as ignore) (J7)
  • [ui] tests/ui/abi/compatibility.rs#i686-reg-struct-return: [missing] -> ignore (gcc backend is marked as ignore) (J7)
  • [ui] tests/ui/abi/compatibility.rs#i686-win: [missing] -> ignore (gcc backend is marked as ignore) (J7)
  • [ui] tests/ui/abi/compatibility.rs#i686-win-gnu: [missing] -> ignore (gcc backend is marked as ignore) (J7)
  • [ui] tests/ui/abi/compatibility.rs#x86-64-win-gnu: [missing] -> ignore (gcc backend is marked as ignore) (J7)
  • [ui] tests/ui/abi/compatibility.rs#aarch64-win: [missing] -> pass (J9)
  • [ui] tests/ui/abi/compatibility.rs#i686-reg-struct-return: [missing] -> pass (J9)
  • [ui] tests/ui/abi/compatibility.rs#i686-win: [missing] -> pass (J9)
  • [ui] tests/ui/abi/compatibility.rs#i686-win-gnu: [missing] -> pass (J9)
  • [ui] tests/ui/abi/compatibility.rs#x86-64-win-gnu: [missing] -> pass (J9)

Additionally, 2 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 50d54098ec9e61b3e2e72daa6368fd98e7f91e83 --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-stdlib-semver-check: 8m 29s -> 15m 50s (+86.6%)
  2. test-x86_64-gnu-llvm-21-2: 1h 5m -> 1h 42m (+56.5%)
  3. dist-x86_64-llvm-mingw: 1h 33m -> 2h 19m (+49.5%)
  4. test-x86_64-gnu-gcc-core-tests: 11m 39s -> 17m 15s (+48.1%)
  5. test-x86_64-gnu: 2h 32m -> 1h 35m (-37.6%)
  6. test-x86_64-gnu-llvm-22-1: 1h 16m -> 51m 8s (-33.4%)
  7. test-x86_64-gnu-miri: 1h 18m -> 52m 20s (-32.9%)
  8. dist-various-2: 50m 4s -> 33m 35s (-32.9%)
  9. dist-i686-mingw: 46m 4s -> 58m 57s (+28.0%)
  10. dist-x86_64-msvc-alt: 2h 57m -> 2h 13m (-25.2%)
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-bors

rust-bors Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#161987 fix is_single_fp_element for s390x and x86 cd996d08282dbbdb60d06811f25eda85bb54de49
(link)
#162366 Replace hard linked metadata.rmeta with a copy when final… ea548d84590762547296ff49fb99993389c2d5ea
(link)
#162552 RISC-V: Add Zmmul target feature 7a3b74269b5419c35f5343994ff0080f7f447f18
(link)
#162602 Ensure concurrent rustc instances in the same process corre… 0c9f12df8f4f1d48cf5a4ed8ac28843270b3e4be
(link)
#162885 Remove one remaining use of Level::Help b7bd640212ca2cb7daec0bcdeafa064449736eb2
(link)
#162606 c-b: Export fmaf16 now that we have an implementation 27a24b34cb237ad016d3e5d8b999bc21ece209cc
(link)
#162817 rustc_{codegen_,}llvm: adapt to new ThreadModel API 56e2a6493e76ca1159f00d9cba5e9754e1f37b17
(link)
#162860 offload: add libLLVM rpath for libomptarget 43ddea31b439fc4fb99b765619a200fec4031d24
(link)
#162895 Avoid derive edits on macro-generated types e1c213f14a84c20ce7871cd02b262a8a635cf88b
(link)
#162899 Error on invalid placements of the cfi_encoding attribute. 969d189da8ff24f41ca24a13e929bed2312198a0
(link)

parent commit: ed30c2ce5e

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (50d5409): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

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

Cycles

Results (primary 2.3%, secondary -6.0%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
6.9% [6.9%, 6.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-8.5% [-20.0%, -4.2%] 5
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 1

Binary size

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

Bootstrap: 497.461s -> 498.048s (0.12%)
Artifact size: 409.61 MiB -> 408.91 MiB (-0.17%)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations 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-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.