Skip to content

Rollup of 15 pull requests#157375

Closed
JonathanBrouwer wants to merge 41 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-2eWHhZL
Closed

Rollup of 15 pull requests#157375
JonathanBrouwer wants to merge 41 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-2eWHhZL

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
@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 a72cf41 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
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

⌛ Trying commit a72cf41 with merge 92a1b0c

To cancel the try build, run the command @bors try cancel.

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

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-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-21-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/attributes/optimize.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/optimize/optimize.stderr`
diff of stderr:

36 LL |     #[optimize(speed)]
37    |     ^^^^^^^^^^^^^^^^^^
38    |
-    = help: `#[optimize]` can be applied to closures, functions, inherent methods, provided trait methods, and trait methods in impl blocks
+    = help: `#[optimize]` can only be applied to functions with a body
40 
---
To only update this specific test, also pass `--test-args attributes/optimize.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/attributes/optimize.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/optimize" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018"
stdout: none
--- stderr -------------------------------
error: `#[optimize]` attribute cannot be used on structs
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:8:1
   |
LL | #[optimize(speed)] //~ ERROR attribute cannot be used on
   | ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on expressions
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:12:5
   |
LL |     #[optimize(speed)] //~ ERROR attribute cannot be used on
   |     ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on modules
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:21:1
   |
LL | #[optimize(speed)] //~ ERROR attribute cannot be used on
   | ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on inherent impl blocks
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:24:1
   |
LL | #[optimize(speed)] //~ ERROR attribute cannot be used on
   | ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on required trait methods
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:45:5
   |
LL |     #[optimize(speed)] //~ ERROR attribute cannot be used on
   |     ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions with a body

error: multiple `optimize` attributes
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:59:1
   |
LL | #[optimize(speed)] //~ ERROR multiple `optimize` attributes
   | ^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /checkout/tests/ui/attributes/optimize.rs:58:1
   |
LL | #[optimize(speed)]
   | ^^^^^^^^^^^^^^^^^^

error: multiple `optimize` attributes
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:63:1
   |
LL | #[optimize(size)] //~ ERROR multiple `optimize` attributes
   | ^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /checkout/tests/ui/attributes/optimize.rs:62:1
   |
LL | #[optimize(speed)]
   | ^^^^^^^^^^^^^^^^^^

error: aborting due to 7 previous errors
------------------------------------------

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 3, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

PR #157297, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors try cancel

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 3, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

Try build cancelled. Cancelled workflows:

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/attributes/optimize.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/attributes/optimize/optimize.stderr`
diff of stderr:

36 LL |     #[optimize(speed)]
37    |     ^^^^^^^^^^^^^^^^^^
38    |
-    = help: `#[optimize]` can be applied to closures, functions, inherent methods, provided trait methods, and trait methods in impl blocks
+    = help: `#[optimize]` can only be applied to functions with a body
40 
---
To only update this specific test, also pass `--test-args attributes/optimize.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/attributes/optimize.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/attributes/optimize" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018"
stdout: none
--- stderr -------------------------------
error: `#[optimize]` attribute cannot be used on structs
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:8:1
   |
LL | #[optimize(speed)] //~ ERROR attribute cannot be used on
   | ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on expressions
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:12:5
   |
LL |     #[optimize(speed)] //~ ERROR attribute cannot be used on
   |     ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on modules
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:21:1
   |
LL | #[optimize(speed)] //~ ERROR attribute cannot be used on
   | ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on inherent impl blocks
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:24:1
   |
LL | #[optimize(speed)] //~ ERROR attribute cannot be used on
   | ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions

error: `#[optimize]` attribute cannot be used on required trait methods
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:45:5
   |
LL |     #[optimize(speed)] //~ ERROR attribute cannot be used on
   |     ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[optimize]` can only be applied to functions with a body

error: multiple `optimize` attributes
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:59:1
   |
LL | #[optimize(speed)] //~ ERROR multiple `optimize` attributes
   | ^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /checkout/tests/ui/attributes/optimize.rs:58:1
   |
LL | #[optimize(speed)]
   | ^^^^^^^^^^^^^^^^^^

error: multiple `optimize` attributes
##[error]  --> /checkout/tests/ui/attributes/optimize.rs:63:1
   |
LL | #[optimize(size)] //~ ERROR multiple `optimize` attributes
   | ^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /checkout/tests/ui/attributes/optimize.rs:62:1
   |
LL | #[optimize(speed)]
   | ^^^^^^^^^^^^^^^^^^

error: aborting due to 7 previous errors
------------------------------------------

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 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.