Skip to content

Rollup of 10 pull requests - #161120

Closed
jhpratt wants to merge 22 commits into
rust-lang:mainfrom
jhpratt:rollup-sDkwIXq
Closed

Rollup of 10 pull requests#161120
jhpratt wants to merge 22 commits into
rust-lang:mainfrom
jhpratt:rollup-sDkwIXq

Conversation

@jhpratt

@jhpratt jhpratt commented Aug 15, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Lfan-ke and others added 22 commits August 4, 2026 23:01
Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com>
Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
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
…ator, r=jhpratt,dtolnay

core: implement FusedIterator for StepBy

Implements the accepted ACP rust-lang/libs-team#757.

`StepBy` yields no more items once its underlying iterator is exhausted, so it is fused whenever the underlying iterator is fused. `StepBy` was added in 1.28.0, just after the batch of `FusedIterator` impls stabilized in 1.26.0 (`Map`, `Skip`, `Take`, `Enumerate`, ...), so it was left out.

```rust
impl<I: FusedIterator> FusedIterator for StepBy<I> {}
```

This is insta-stable, matching the sibling adapter impls, so it needs a libs-api FCP.

Motivation from the ACP: crates with traits refined on top of `FusedIterator` (e.g. `range-set-blaze`'s `SortedStarts`) cannot cover `StepBy` today, even though it would always be valid.

A `test_step_by_fused` regression test is added.
…ions, r=traviscross

tests/ui/union: add annotations for reference rules

r? lang-docs
…=clubby789

cargotest: replace Servo with standalone Stylo

The Servo entry in `cargotest` pins a 2019 checkout and only tests the
`selectors` package. Cargo still has to resolve the old Servo workspace,
including its large graph of Git dependencies, even though most of that
workspace is not covered by the test.

Both `selectors` and the `stylo` CSS engine now live in the standalone
[`servo/stylo`](https://github.com/servo/stylo) repository. This PR replaces
the old Servo checkout with a recent Stylo revision and runs both
`cargo test -p selectors` and `cargo test -p stylo` from the same checkout.

Stylo's unit tests previously failed under the default Servo configuration
because shared tests used pseudo-elements that were only available in Gecko.
This was fixed in [`servo/stylo#436`](servo/stylo#436),
and this PR pins the resulting revision.

The `cargotest` documentation is updated to list Stylo instead of Servo.

Tests:

- `cargo test --manifest-path src/tools/cargotest/Cargo.toml`
- `target/debug/cargotest "$(command -v cargo)" /tmp/cargotest-stylo stylo`
- `./x test tidy --set build.submodules=false`

Closes rust-lang#79404.
…st-2018, r=traviscross

tests/ui/rust-2018: add annotations for reference rules
…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.
…anBrouwer

Revert "Add regression test for const fn returning Vec of boxed dyn Any"

Reverts rust-lang#161010 as requested, it was a feature stabilized not a bug
r? @chenyukang
…, 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
rustc.1: `-O` is `-C opt-level=3`

This was changed back in 1.86, rust-lang#135439.
@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-rustc-dev-guide Area: rustc-dev-guide 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 15, 2026
@rustbot rustbot added 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
@jhpratt

jhpratt commented Aug 15, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=5

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

@rust-bors

rust-bors Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1d79916 has been approved by jhpratt

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 Bot pushed a commit that referenced this pull request Aug 15, 2026
Rollup of 10 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-*
try-job: x86_64-mingw-1
try-job: i686-msvc-*
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

This rollup contains 6 PRs which were already merged

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 15, 2026
@rust-bors

rust-bors Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@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
@jhpratt
jhpratt deleted the rollup-sDkwIXq branch August 15, 2026 04:41
@rust-bors

rust-bors Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4a9be9c (4a9be9c5e91e6e34386b47874990d84de6343c48)
Base parent: d453bdd (d453bdd8f092d099bc336f0bda4163f809ad18e0)

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-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.