Skip to content

Rollup of 5 pull requests - #161128

Merged
rust-bors[bot] merged 12 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-8wE5OZB
Aug 15, 2026
Merged

Rollup of 5 pull requests#161128
rust-bors[bot] merged 12 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-8wE5OZB

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

nia-e and others added 12 commits August 13, 2026 09:15
Take bors try-perf branch into account in verify-channel.sh

Forgot about this in rust-lang#160693.

r? @Mark-Simulacrum
…, r=tgross35

Stabilize `extern "custom"`

tracking issue: rust-lang#140829
reference PR: rust-lang/reference#2300
closes rust-lang#140829

## Summary

An `extern "custom" fn` is a function with a custom ABI that is unknown to rust. Often these are low-level functions that pass arguments in different registers than any standard calling convention.

```rust
#[unsafe(naked)]
pub unsafe extern "custom" fn __aeabi_uidivmod() {
    core::arch::naked_asm!(
        "push {{lr}}",
        "sub sp, sp, rust-lang#4",
        "mov r2, sp",
        "bl {trampoline}",
        "ldr r1, [sp]",
        "add sp, sp, rust-lang#4",
        "pop {{pc}}",
        trampoline = sym crate::arm::__udivmodsi4
    );
}

unsafe extern "custom" {
	fn __fentry__();
}
```

## Design

Because rust doesn't know what calling convention to use, an `extern "custom"` function can only be called via inline assembly or FFI.

```
error: functions with the "custom" ABI cannot be called
 --> <source>:5:5
  |
5 |     bar();
  |     ^^^^^
  |
note: an `extern "custom"` function can only be called using inline assembly
```

An `extern "custom"` function definition must be a naked function:

```
error: items with the "custom" ABI can only be declared externally or defined via naked functions
  --> <source>:10:1
   |
10 | unsafe extern "custom" fn bar() {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: convert this to an `#[unsafe(naked)]` function
   |
10 + #[unsafe(naked)]
11 | unsafe extern "custom" fn bar() {
   |
```

An `extern "custom"` function definition must be unsafe. The intent here is that a safety comment is written on how this function may be called.

```
error: functions with the "custom" ABI must be unsafe
  --> <source>:10:1
   |
10 | extern "custom" fn bar() {
   | ^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: add the `unsafe` keyword to this definition
   |
10 | unsafe extern "custom" fn bar() {
   | ++++++
```

In an `extern "custom"` block, functions cannot be marked as `safe`:

```
error: foreign functions with the "custom" ABI cannot be safe
  --> <source>:16:5
   |
16 |     safe fn foobar();
   |     ^^^^^^^^^^^^^^^^^
   |
help: remove the `safe` keyword from this definition
   |
16 -     safe fn foobar();
16 +     fn foobar();
```

An `extern "custom"` function cannot have any arguments or a return type:

```
error: invalid signature for `extern "custom"` function
 --> <source>:6:31
  |
6 | unsafe extern "custom" fn foo(a: i32) -> i32 {
  |                               ^^^^^^     ^^^
  |
  = note: functions with the "custom" ABI cannot have any parameters or return type
help: remove the parameters and return type
  |
6 - unsafe extern "custom" fn foo(a: i32) -> i32 {
6 + unsafe extern "custom" fn foo() {
  |
```

## Tests

- [tests/ui/abi/custom.rs](https://github.com/rust-lang/rust/blob/main/tests/ui/abi/custom.rs) tests that the feature works as expected, e.g. that functions can be defined, symbols are defined, and extern blocks can be used.
- [tests/ui/abi/bad-custom.rs](https://github.com/rust-lang/rust/blob/main/tests/ui/abi/bad-custom.rs) checks the restrictions: definitions must be unsafe and naked, attempting to call an `extern "custom"` function gives an error, etc.
-
## History

* rust-lang#140566
* rust-lang#140829
* rust-lang#140770
* rust-lang#159780

## unresolved questions

None
…crum

mailmap: fix nia's gazillion emails

Title. The `@hexcat.nl` one isn't used for any existing commits but there's a good chance it will be in the near future.
…, r=Urgau

rustdoc: Small `doc_cfg` messages improvements

Fixes rust-lang#145075.

I was writing a regression test for rust-lang#145075 which was already fixed, saw it was looking like this:

<img width="242" height="247" alt="image" src="https://github.com/user-attachments/assets/421e6b4b-698f-4a01-93d9-022eb346d73c" />

So I made some small changes to improve the wording. Now it looks like this:

<img width="242" height="247" alt="image" src="https://github.com/user-attachments/assets/c950dd68-a760-4f18-b974-555e05fcfd78" />

r? @Urgau
bootstrap: Clean up some inconsistent imports and paths

I have been experimenting with moving code out of bootstrap's `lib.rs`, and along the way I noticed a few inconsistently-used imports and qualified paths that add friction to that process.

There should be no change to bootstrap behaviour.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 15, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc 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-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. 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 Aug 15, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ p=5

@rust-bors

rust-bors Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 908d0a5 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 Aug 15, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added the merged-by-bors This PR was explicitly merged by bors. label Aug 15, 2026
@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 15, 2026
@rust-bors

rust-bors Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 13m 45s
Pushing 110d7e5 to main...

@rust-bors
rust-bors Bot merged commit 110d7e5 into rust-lang:main Aug 15, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 15, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#161111 Take bors try-perf branch into account in verify-channel.sh 92f6aa3e24df99d34f0fab060f53bd38217edaec (link)
#158504 Stabilize extern "custom" 3fccc22298fb631380fba1be2fec1350de5462e9 (link)
#161030 mailmap: fix nia's gazillion emails 52a2e862054bfdccd3d575a6fe587508118e6be2 (link)
#161105 rustdoc: Small doc_cfg messages improvements d4cb157d52067b74a9e59488ec8e62db36513fad (link)
#161123 bootstrap: Clean up some inconsistent imports and paths 8f0a087f54a75b53bd8a4a04a9d699aa77b25247 (link)

previous master: 842475214b

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

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 8424752 (parent) -> 110d7e5 (this PR)

Test differences

Show 8 test diffs

Stage 1

  • [ui (polonius)] tests/ui/feature-gates/feature-gate-abi-custom.rs: pass -> [missing] (J1)
  • [rustdoc-html] tests/rustdoc-html/doc-cfg/always-true.rs: [missing] -> pass (J3)
  • [ui] tests/ui/feature-gates/feature-gate-abi-custom.rs: pass -> [missing] (J5)

Stage 2

  • [rustdoc-html] tests/rustdoc-html/doc-cfg/always-true.rs: [missing] -> pass (J0)
  • [run-make] tests/run-make/compressed-debuginfo-zstd: ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) -> pass (J2)
  • [ui] tests/ui/feature-gates/feature-gate-abi-custom.rs: pass -> [missing] (J4)

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 110d7e55dbd37e65cdc3321a204a9911af35f533 --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-stdlib-semver-check: 24m 26s -> 10m 45s (-56.0%)
  2. dist-arm-linux-musl: 1h 12m -> 1h 48m (+49.0%)
  3. dist-loongarch64-linux: 1h 16m -> 1h 54m (+48.8%)
  4. x86_64-gnu-llvm-21: 36m 13s -> 53m 29s (+47.7%)
  5. x86_64-gnu-gcc-core-tests: 26m 56s -> 14m 46s (-45.2%)
  6. x86_64-gnu: 2h 47m -> 1h 49m (-34.7%)
  7. dist-i686-mingw: 2h 6m -> 2h 45m (+31.4%)
  8. x86_64-gnu-aux: 2h 51m -> 2h (-29.9%)
  9. pr-check-2: 53m 54s -> 38m 24s (-28.8%)
  10. x86_64-gnu-tools: 1h 18m -> 56m 43s (-28.1%)
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 (110d7e5): 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 2.7%)

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

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

Cycles

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

Binary size

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

Bootstrap: 460.295s -> 462.121s (0.40%)
Artifact size: 396.91 MiB -> 396.97 MiB (0.02%)

@rust-bors

rust-bors Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#161111 Take bors try-perf branch into account in verify-channel.sh f1a9740ae463762380ae36015b2d886dbbb3ecfc
(link)
#158504 Stabilize extern "custom" ❌ build failed
#161030 mailmap: fix nia's gazillion emails ❌ build failed
#161105 rustdoc: Small doc_cfg messages improvements ❌ build failed
#161123 bootstrap: Clean up some inconsistent imports and paths ❌ build failed

parent commit: 842475214b

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

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-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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. 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.

8 participants