Skip to content

Rollup of 9 pull requests - #160814

Merged
rust-bors[bot] merged 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-5WAvt58
Aug 9, 2026
Merged

Rollup of 9 pull requests#160814
rust-bors[bot] merged 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-5WAvt58

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

folkertdev and others added 19 commits July 22, 2026 23:57
It was never used in that crate, so rustc_parse is the next obvious place to go. It's also used by rustc_hir_typeck, but sharing diagnostics between crates makes it easy for such things to become dead, so duplicate it.
And fix support for multi-line attributes. And add some tests.
rustc_attr_ir: fix up `lang_items` imports

Cleanup after splitting attributes from rustc_hir.

It's a big one and maybe annoying to merge without conflicts but I figured it's best to just get it done and over with. If it turns out to be too big to merge at once it should be possible to split it up tho :>

r? @JonathanBrouwer
…ked-functions, r=tiif

stabilize `c_variadic_naked_functions`

tracking issue: rust-lang#148767
reference PR: rust-lang/reference#2321

# Stabilization report

## Summary

Stabilize the ability to use `#[unsafe(naked)]` functions to define c-variadic functions. These c-variadic naked functions accept the same set of ABIs as c-variadic foreign functions, this set is larger than what we currently accept for c-variadic definitions.

```rust
#[unsafe(naked)]
unsafe extern "aapcs" fn variadic_aapcs(_: f64, _: ...) -> f64 {
    core::arch::naked_asm!(
        r#"
        sub     sp, sp, rust-lang#12
        stmib   sp, {{r2, r3}}
        vmov    d0, r0, r1
        add     r0, sp, rust-lang#4
        vldr    d1, [sp, rust-lang#4]
        add     r0, r0, rust-lang#15
        bic     r0, r0, rust-lang#7
        vadd.f64        d0, d0, d1
        add     r1, r0, rust-lang#8
        str     r1, [sp]
        vldr    d1, [r0]
        vadd.f64        d0, d0, d1
        vmov    r0, r1, d0
        add     sp, sp, rust-lang#12
        bx      lr
    "#,
    )
}
```

## Accepted ABIs

The set of accepted ABIs is the same as for c-variadic foreign functions, defined as rule [`items.extern.variadic.conventions`](https://doc.rust-lang.org/nightly/reference/items/external-blocks.html?highlight=externblo#r-items.extern.variadic.conventions):

- `"aapcs"`
- `"C"`
- `"cdecl"`
- `"efiapi"`
- `"system"`
- `"sysv64"`
- `"win64"`

And their corresponding `-unwind` variants. Given that naked functions desugar to a block of module assembly and a foreign definition, it makes sense to support the same set as source-level foreign definitions.

For c-variadic definitions we only accept `"C"` and `"C-unwind"`.

## Multiple c-variadic ABIs in the same program

LLVM supports c-variadic calls of different ABIs in the same program. We test both an arm and x86 configuration

- https://github.com/rust-lang/rust/blob/771916f9028e7fe56d2685f2c4f698de5d7d6a45/tests/ui/c-variadic/same-program-multiple-abis-arm.rs
- https://github.com/rust-lang/rust/blob/771916f9028e7fe56d2685f2c4f698de5d7d6a45/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs

Note that GCC, Clang and LLVM do not support c-variadic definitions of multiple ABIs: the `va_start`, `va_arg` etc. macros are always expanded using the default C calling convention. Clang and GCC reject a variable argument list on definitions that use a non-default calling convention.

## History

- [#t-lang > C-variadic naked functions](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/C-variadic.20naked.20functions/with/554593886)
- rust-lang#148770

The stabilization report of `feature(c_variadic)` mentions this feature:

- rust-lang#155697

## Unresolved questions

None.
…idy, r=Mark-Simulacrum

Refactor tidy detection of stability attribute

And fix support for multi-line attributes. And add some tests.

Necessary for rust-lang#160108 which confused tidy.
…r=JonathanBrouwer

make more diagnostic structs pub(crate)
…nBrouwer

Add regression test for cycle error on guaranteed unsized self type

Closes rust-lang#116914 the solver now detects the cycle and errors, which this pins
arm64ec: `f128` is supported since LLVM 23

tracking issue: rust-lang#116909

- [x] I did not use an LLM to create a change in this PR.
- [ ] I used an LLM to create a change in this PR, and I have explained below how it was used.

Related

- llvm/llvm-project#94434
- llvm/llvm-project#206980

cc @dpaoliello (feel free to approve also, and maybe you can validate this in practice?)
r? tgross35
Add regression test for save temps ICE on incremental recompile

Closes rust-lang#66367 adds an incremental regression test for adding -C save-tempsthat used to ICE
…=Mark-Simulacrum

User facing .expect now follows “expect as precondition" style

Related issue: rust-lang#159751

Updated .expect error message in std/src/net/tcp.rs to follow “expect as precondition" style.
…d.rs, r=nia-e

Change .expect message to follow precondition style
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 9, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-tidy Area: The tidy tool 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-clippy Relevant to the Clippy team. 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 9, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 9, 2026
Rollup of 9 pull requests


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

This comment has been minimized.

@rust-bors

rust-bors Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 2cfd421 (2cfd421b4a383b331dce94a599e5b9a0d7f12fb1)
Base parent: 153ecc4 (153ecc4f74035b709bb3e1eb9546f1d934865042)

@rust-bors rust-bors Bot added the merged-by-bors This PR was explicitly merged by bors. label Aug 9, 2026
@rust-bors

rust-bors Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 2m 6s
Pushing 969b803 to main...

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 9, 2026
@rust-bors
rust-bors Bot merged commit 969b803 into rust-lang:main Aug 9, 2026
15 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 9, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#160782 rustc_attr_ir: fix up lang_items imports 08fef6e799d9c49068836018463094528c4ab4a4 (link)
#159746 stabilize c_variadic_naked_functions c9716be22595b06e844b8c32fbd6b8990c5b3e20 (link)
#160141 Refactor tidy detection of stability attribute 5a9cb59b0fcee2c401d1046ee7b1982d114ffd4c (link)
#160744 make more diagnostic structs pub(crate) ceb3990d054aebd187c5420419501d947d6bf76b (link)
#160778 Add regression test for cycle error on guaranteed unsized s… 4f3a81fd925622b5bc39f9cb6d4ecaa0e7d822b9 (link)
#160779 arm64ec: f128 is supported since LLVM 23 86ccdcc846f76ed952c55e68e041dd9aac853ca1 (link)
#160781 Add regression test for save temps ICE on incremental recom… 35f23da4d7a2a485d5fd84222845f8650f510364 (link)
#160792 User facing .expect now follows “expect as precondition" … 33c9dbf079ed4fd652b18bc6415d1030238ccb46 (link)
#160796 Change .expect message to follow precondition style 7e1f6feb576b8fc8b4ca30bda4878b9afe8ee6c6 (link)

previous master: 5c16940f0d

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

@github-actions

github-actions Bot commented Aug 9, 2026

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 5c16940 (parent) -> 969b803 (this PR)

Test differences

Show 388 test diffs

Stage 0

  • features::tests::extract_lib_features_invalid: [missing] -> pass (J0)
  • features::tests::extract_lib_features_invalid_multiline: [missing] -> pass (J0)

Stage 1

  • [ui] tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/cycle-guaranteed-unsized-self-type-116914.rs: [missing] -> pass (J1)
  • [incremental] tests/incremental/save-temps-66367.rs: [missing] -> pass (J2)
  • [ui (polonius)] tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs: pass -> [missing] (J4)
  • [ui (polonius)] tests/ui/traits/cycle-guaranteed-unsized-self-type-116914.rs: [missing] -> pass (J4)

Stage 2

  • [incremental] tests/incremental/save-temps-66367.rs: [missing] -> pass (J3)
  • [ui] tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs: pass -> [missing] (J5)
  • [ui] tests/ui/traits/cycle-guaranteed-unsized-self-type-116914.rs: [missing] -> pass (J6)
  • [ui] tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs: ignore (gcc backend is marked as ignore) -> [missing] (J7)

Additionally, 377 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 969b803cbe1d4499f841ae0a49c637d8c70a0458 --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. x86_64-gnu-parallel-frontend: 1h 21m -> 2h 12m (+64.1%)
  2. i686-gnu-1: 1h 28m -> 2h 22m (+61.1%)
  3. dist-arm-linux-musl: 1h 7m -> 1h 42m (+52.5%)
  4. dist-x86_64-netbsd: 59m 46s -> 1h 28m (+47.9%)
  5. x86_64-gnu-llvm-22-2: 1h 6m -> 1h 32m (+40.3%)
  6. x86_64-mingw-1: 2h 4m -> 2h 51m (+38.1%)
  7. dist-powerpc64-linux-gnu: 1h 36m -> 59m 51s (-37.9%)
  8. x86_64-gnu-miri: 1h 2m -> 1h 25m (+36.2%)
  9. x86_64-gnu-llvm-21-1: 42m 28s -> 56m 20s (+32.6%)
  10. i686-gnu-nopt-2: 1h 41m -> 2h 14m (+32.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
Collaborator

Finished benchmarking commit (969b803): 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.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

Max RSS (memory usage)

Results (primary 3.5%, secondary 0.6%)

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

mean range count
Regressions ❌
(primary)
3.5% [3.5%, 3.5%] 1
Regressions ❌
(secondary)
1.1% [0.5%, 4.2%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-2.2%, -0.5%] 3
All ❌✅ (primary) 3.5% [3.5%, 3.5%] 1

Cycles

Results (primary 2.3%, secondary 0.7%)

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.1%, 2.6%] 2
Regressions ❌
(secondary)
1.2% [0.5%, 3.5%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.1% [-2.0%, -0.5%] 3
All ❌✅ (primary) 2.3% [2.1%, 2.6%] 2

Binary size

Results (primary 0.1%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.1%] 29
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 21
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 29

Bootstrap: 461.157s -> 458.441s (-0.59%)
Artifact size: 398.54 MiB -> 398.59 MiB (0.01%)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-tidy Area: The tidy tool 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-clippy Relevant to the Clippy team. 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-rustdoc Relevant to the rustdoc 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.

9 participants