Skip to content

Rollup of 15 pull requests#157376

Open
JonathanBrouwer wants to merge 40 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rUrUphg
Open

Rollup of 15 pull requests#157376
JonathanBrouwer wants to merge 40 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rUrUphg

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

P8L1 and others added 30 commits May 17, 2026 21:06
We already have a vector of `CoroutineSavedTy`, no need to have a separate
one just for debuginfo.
Avoid complicated loops just for an optimization.
`coroutine.rs` was getting too large, and mixing MIR analyses for trait
solving and runtime transformations.
This was necessary when transitioning from JS to wasm exception handling
on Emscripten. Enough time has probably passed that we no longer need to
support JS exception handling on Emscripten. This enables cleaning up a
fair bit of code.
this removes the panic path when dividing by the frequency.
this also makes calls to Instant::now() faster.
…=petrochenkov

Promotes 5 Thumb-mode bare-metal Arm targets to Tier 2

This PR promotes five Thumb-mode bare-metal Arm targets to Tier 2, joining their Arm-mode counterparts which are already Tier 2:

| Thumb-mode target (Tier 3 → Tier 2) | Arm-mode counterpart (already Tier 2) |
|:---|:---|
| `thumbv7a-none-eabi` | `armv7a-none-eabi` |
| `thumbv7a-none-eabihf` | `armv7a-none-eabihf` |
| `thumbv7r-none-eabi` | `armv7r-none-eabi` |
| `thumbv7r-none-eabihf` | `armv7r-none-eabihf` |
| `thumbv8r-none-eabihf` | `armv8r-none-eabihf` |

Note: There is no `thumbv8r-none-eabi` target because the Cortex-R52 processor always includes an FPU, making a soft-float ABI variant unnecessary.

These Thumb-mode targets generate T32 code by default while their Arm-mode counterparts generate A32 code. They share the same LLVM backend, ABI, and data layout — the only spec differences are the `llvm_target` string and the description.

See rust-lang/compiler-team#985
…-incorrect-gen-args, r=petrochenkov

delegation: emit error when there is an infer lifetime in user-specified args

This PR checks emit error if there as an infer lifetime anywhere in delegation's user-specified args. And `delegation_user_specified_args` is now query as we invoke it two times.

Fixes rust-lang#156848. Part of rust-lang#118212.
r? @petrochenkov
…t-of-first-arg, r=petrochenkov

delegation: move statements out of the first arg

This PR moves statements that precede final block expression out of the first argument, so we can apply adjustments to final block expression in more cases.

This changes behavior a bit, for example if we specify an empty block:
```rust
fn b<C>(e: C) {}
reuse b {}

// Desugaring:
fn b<C>(arg0: _) -> _ { b::<C>(arg0) }
```

So we generated the first arg and block is no-op.

In general scenario:
```rust
trait Trait: Sized { //~ WARN trait `Trait` is never used
    fn by_value(self, x: i32) -> i32 { x }
    fn by_ref(&self, x: i32) -> i32 { x }
    fn by_mut_ref(&mut self, x: i32) -> i32 { x }
}

struct F; //~ WARN struct `F` is never constructed
impl Trait for F {}

struct S(F); //~ WARN struct `S` is never constructed
impl Trait for S {
    reuse <F as Trait>::* {
        println!();
        // Final expression is adjusted even if it is in a block.
        self.0
    }
}

// Desugaring:
#[attr = Inline(Hint)]
fn by_value(self: _, arg1: _)
    ->
        _ {
    // Final expression is adjusted even if it is in a block.

    { ::std::io::_print(format_arguments::from_str("\n")); };
    <F as Trait>::by_value(self.0, arg1)
}
#[attr = Inline(Hint)]
fn by_ref(self: _, arg1: _)
    ->
        _ {
    { ::std::io::_print(format_arguments::from_str("\n")); };
    <F as Trait>::by_ref(self.0, arg1)
}
#[attr = Inline(Hint)]
fn by_mut_ref(self: _, arg1: _)
    ->
        _ {
    { ::std::io::_print(format_arguments::from_str("\n")); };
    <F as Trait>::by_mut_ref(self.0, arg1)
}
```

If we change target expression to
```rust
reuse <F as Trait>::* {
    println!();
    let x = 1;
}

// Desugaring:
#[attr = Inline(Hint)]
fn by_value(self: _, arg1: _)
    ->
        _ {

    { ::std::io::_print(format_arguments::from_str("\n")); };
    let x = 1;
    <F as Trait>::by_value(self, arg1)
}
```

Once again we generated default arguments for function and block is no-op now (meaning it does not affect callee arguments).

Part of rust-lang#118212.
r? @petrochenkov
rustc_codegen_ssa: Refactor `ArchiveEntry` to include entry kind

Needed for rust-lang#155338 in particular.

r? @bjorn3
…jorn3

Use weak linkage for EII defaults

hard to find a test for this, but weak seems more correct (after private discussion with @bjorn3)

Also changes a log statement to make it a lil easier to see what's going on.

r? @bjorn3
…xyUwU

Const generics: remove AliasTerm::kind(), and small fixes

When implementing rust-lang#157094 there were a few things I stumbled upon that I fixed, that were technically unrelated, and because that PR was already getting so big, I split the silly nitpick fixups into another PR (this PR).

- first commit: `cx.alias_term_kind_from_def_id(goal.predicate.def_id())` can be written as just `goal.predicate.alias.kind`, without a query. doh.
- second commit: remove `AliasTerm::kind()` (instead accessing the field `AliasTerm::kind` directly)
  - this also removes the interner parameter from `AliasTerm::expect_ct`/`AliasTerm::expect_ty`, yippee

r? @BoxyUwU
…=oli-obk

Split coroutine layout computation to its own file

`coroutine.rs` is getting too large, and mixes MIR analyses for trait solving and runtime transformations.
…ChrisDenton

windows: Elide division-by-zero checks in Instant::now()

This PR teaches LLVM that the frequency of the performance counter is non null so it is able to remove division by zero checks.
This removes the panic path in `mul_div_u64` and should make calls to `Instant::now()` (very slightly) faster.

As seen in the assembly (see godbolt below), telling LLVM that the frequency is non zero suffices to get the optimization, but I don't know if it could be a great idea to also update the signature of `mul_div_u64`?

MSDN page for [QueryPerformanceFrequency](https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency):
> On systems that run Windows XP or later, the function will always succeed when given valid parameters and will thus never return zero.

Godbolt: https://rust.godbolt.org/z/xr6x8MrPE
…lt, r=JonathanBrouwer

Enable `clippy::mem_replace_with_default`

Enables `clippy::mem_replace_with_default` and fixes the errors that occur as a result.

Closes rust-lang#157245.
…r=petrochenkov

Fix trivial wf module argument/doc comment name mismatches

Some instances of `arg` in the `wf` module got renamed to `term` a while back, but the doc comments were not updated. This PR updates to `term`.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 3, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows 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-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) labels Jun 3, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

Trying commonly failed jobs
@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-2

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

📌 Commit 49d5453 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 Jun 3, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 3, 2026
Rollup of 15 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-2
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

⌛ Testing commit 49d5453 with merge e164200...

Workflow: https://github.com/rust-lang/rust/actions/runs/26886626483

rust-bors Bot pushed a commit that referenced this pull request Jun 3, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #155763 (Promotes 5 Thumb-mode bare-metal Arm targets to Tier 2)
 - #156953 (delegation: emit error when there is an infer lifetime in user-specified args)
 - #157248 (delegation: move statements out of the first arg)
 - #157263 (rustc_codegen_ssa: Refactor `ArchiveEntry` to include entry kind)
 - #157311 (Use weak linkage for EII defaults)
 - #156089 (Fix unused_parens for pinned reference patterns)
 - #156928 (Remove -Zemscripten-wasm-eh)
 - #157236 (Reorganize `tests/ui/issues` [3/N])
 - #157287 (Const generics: remove AliasTerm::kind(), and small fixes)
 - #157294 (Split coroutine layout computation to its own file)
 - #157328 (windows: Elide division-by-zero checks in Instant::now())
 - #157331 (Rewrite target checking for `#[link]`)
 - #157336 (Enable `clippy::mem_replace_with_default`)
 - #157362 (Fix trivial wf module argument/doc comment name mismatches)
 - #157364 (Rewrite target checking of `rustc_dummy`)

Failed merges:

 - #157332 (Rewrite target checking for `#[sanitize]`)
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

☀️ Try build successful (CI)
Build commit: 50d308a (50d308a24e0f050506b17a4299075518642721cc, parent: 53509ca37e3b507887607c2f4a7f23bd4838f099)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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-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.