Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Nov 3, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

cuviper and others added 25 commits October 28, 2025 15:27
Ubuntu 25.10 has `llvm-21` packages that we can test with.
The `Dockerfile` is otherwise the same as the `llvm-20` runners.
```
error[E0401]: can't use generic parameters from outer item
  --> $DIR/enum-definition-with-outer-generic-parameter-5997.rs:3:16
   |
LL | fn f<Z>() -> bool {
   |      - type parameter from outer item
LL |     enum E { V(Z) }
   |                ^ use of generic parameter from outer item
   |
help: try introducing a local generic parameter here
   |
LL |     enum E<Z> { V(Z) }
   |           +++
```
```
error[E0401]: can't use generic parameters from outer item
  --> $DIR/E0401.rs:4:39
   |
LL | fn foo<T>(x: T) {
   |        - type parameter from outer item
LL |     fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
   |        ----                           ^ use of generic parameter from outer item
   |        |
   |        generic parameter used in this inner function
   |
help: try introducing a local generic parameter here
   |
LL |     fn bfnr<T, U, V: Baz<U>, W: Fn()>(y: T) {
   |             ++
```
```
error[E0401]: can't reference `Self` constructor from outer item
  --> $DIR/do-not-ice-on-note_and_explain.rs:6:13
   |
LL | impl<B> A<B> {
   | ------------ the inner item doesn't inherit generics from this impl, so `Self` is invalid to reference
LL |     fn d() {
LL |         fn d() {
   |            - `Self` used in this inner item
LL |             Self(1)
   |             ^^^^ help: replace `Self` with the actual type: `A`
```
```
error[E0401]: can't use generic parameters from outer item
  --> $DIR/const-param-from-outer-fn.rs:3:9
   |
LL | fn foo<const X: u32>() {
   |              - const parameter from outer item
LL |     fn bar() -> u32 {
   |        --- generic parameter used in this inner function
LL |         X
   |         ^ use of generic parameter from outer item
   |
help: try introducing a local generic parameter here
   |
LL |     fn bar<X>() -> u32 {
   |           +++
```
…cs to cg_llvm

This is a workaround for an LLVM bug, so put it in cg_llvm.
The panic runtime uses #[rustc_std_internal_symbol] which has the same
effect as this special case with respect to symbol visibility.
When encountering an unmet `Ty: [const] Trait` bound, if `Trait` is `#[const_trait]` and there's an `impl Trait for Ty` point at it. If local, suggest `impl const Trait for Ty`, otherwise just point at it.

```
error[E0277]: the trait bound `NonConstAdd: [const] Add` is not satisfied
  --> $DIR/assoc-type.rs:37:16
   |
LL |     type Bar = NonConstAdd;
   |                ^^^^^^^^^^^
   |
note: required by a bound in `Foo::Bar`
  --> $DIR/assoc-type.rs:33:15
   |
LL |     type Bar: [const] Add;
   |               ^^^^^^^^^^^ required by this bound in `Foo::Bar`
help: make the `impl` of trait `Add` `const`
   |
LL | impl const Add for NonConstAdd {
   |      +++++
```
```
error[E0277]: the trait bound `T: [const] PartialEq` is not satisfied
    --> tests/ui/traits/const-traits/call-generic-method-fail.rs:5:5
     |
5    |     *t == *t
     |     ^^^^^^^^
     |
note: trait `PartialEq` is implemented but not `const`
    --> /home/gh-estebank/rust/library/core/src/ptr/const_ptr.rs:1590:1
     |
1590 | impl<T: PointeeSized> PartialEq for *const T {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: trait `PartialEq` is implemented but not `const`
    --> /home/gh-estebank/rust/library/core/src/ptr/mut_ptr.rs:2011:1
     |
2011 | impl<T: PointeeSized> PartialEq for *mut T {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Point at trait and associated item when that associated item is used in a const context. Suggest making the trait `#[const_trait]`.

```
error[E0015]: cannot call non-const method `<() as Trait>::foo` in constant functions
  --> $DIR/inline-incorrect-early-bound-in-ctfe.rs:26:8
   |
LL |     ().foo();
   |        ^^^^^
   |
note: method `foo` is not const because trait `Trait` is not const
  --> $DIR/inline-incorrect-early-bound-in-ctfe.rs:13:1
   |
LL | trait Trait {
   | ^^^^^^^^^^^ this trait is not const
LL |     fn foo(self);
   |     ------------- this method is not const
   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: consider making trait `Trait` const
   |
LL + #[const_trait]
LL | trait Trait {
   |
```
```
error[E0015]: cannot call non-const associated function `Foo::{constant#0}::Foo::<17>::value` in constants
  --> $DIR/nested-type.rs:15:5
   |
LL |   struct Foo<const N: [u8; {
   |  __________________________-
LL | |     struct Foo<const N: usize>;
LL | |
LL | |     impl<const N: usize> Foo<N> {
...  |
LL | |     Foo::<17>::value()
   | |     ^^^^^^^^^^^^^^^^^^
LL | |
LL | | }]>;
   | |_- calls in constants are limited to constant functions, tuple structs and tuple variants
```
Provide additional context to errors involving const traits

When encountering an unmet `Ty: [const] Trait` bound, if `Trait` is `#[const_trait]` and there's an `impl Trait for Ty` point at it. If local, suggest `impl const Trait for Ty`, otherwise just point at it.

```
error[E0277]: the trait bound `NonConstAdd: [const] Add` is not satisfied
  --> $DIR/assoc-type.rs:37:16
   |
LL |     type Bar = NonConstAdd;
   |                ^^^^^^^^^^^
   |
note: required by a bound in `Foo::Bar`
  --> $DIR/assoc-type.rs:33:15
   |
LL |     type Bar: [const] Add;
   |               ^^^^^^^^^^^ required by this bound in `Foo::Bar`
help: make the `impl` of trait `Add` `const`
   |
LL | impl const Add for NonConstAdd {
   |      +++++
```
```
error[E0277]: the trait bound `T: [const] PartialEq` is not satisfied
    --> tests/ui/traits/const-traits/call-generic-method-fail.rs:5:5
     |
5    |     *t == *t
     |     ^^^^^^^^
     |
note: trait `PartialEq` is implemented but not `const`
    --> /home/gh-estebank/rust/library/core/src/ptr/const_ptr.rs:1590:1
     |
1590 | impl<T: PointeeSized> PartialEq for *const T {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: trait `PartialEq` is implemented but not `const`
    --> /home/gh-estebank/rust/library/core/src/ptr/mut_ptr.rs:2011:1
     |
2011 | impl<T: PointeeSized> PartialEq for *mut T {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
ci: add runners for vanilla LLVM 21

Ubuntu 25.10 has `llvm-21` packages that we can test with.
The `Dockerfile` is otherwise the same as the `llvm-20` runners.
…fleLapkin

rustc_codegen: fix musttail returns for cast/indirect ABIs

Fixes rust-lang#148239 rust-lang#144986

Explicit tail calls trigger `bug!` for any callee whose ABI returns via `PassMode::Cast`, and we forgot to to forward the hidden `sret` out-pointer when the ABI requested an indirect return. The former causes ICE, the latter produced malformed IR (wrong codegen) if the return value is large enough to need `sret`.

Updated the musttail helper to accept cast-mode returns, made it so that we pass the return pointer through the tail-call path.

Added two UI tests to demonstrate each case.

This is my first time contributing, please do check if I did it right.

r? theemathas
…, r=WaffleLapkin

Remove a special case and move another one out of reachable_non_generics

One is no longer necessary, the other is best placed in cg_llvm as it works around a cg_llvm bug.
…ouwer

Point at inner item when it uses generic type param from outer item or `Self`

Partially address rust-lang#37892.

In E0401 generated in resolve:
```
error[E0401]: can't use generic parameters from outer item
  --> $DIR/E0401.rs:4:39
   |
LL | fn foo<T>(x: T) {
   |        - type parameter from outer item
LL |     fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
   |        ----                           ^ use of generic parameter from outer item
   |        |
   |        generic parameter used in this inner function
   |
help: try introducing a local generic parameter here
   |
LL |     fn bfnr<T, U, V: Baz<U>, W: Fn()>(y: T) {
   |             ++
```
In E0401 generated in hir_typeck:
```
error[E0401]: can't reference `Self` constructor from outer item
  --> $DIR/do-not-ice-on-note_and_explain.rs:6:13
   |
LL | impl<B> A<B> {
   | ------------ the inner item doesn't inherit generics from this impl, so `Self` is invalid to reference
LL |     fn d() {
LL |         fn d() {
   |            - `Self` used in this inner item
LL |             Self(1)
   |             ^^^^ help: replace `Self` with the actual type: `A`
```
@rustbot rustbot added A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc F-explicit_tail_calls `#![feature(explicit_tail_calls)]` labels Nov 3, 2025
@rustbot rustbot added 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. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 3, 2025
@Zalathar
Copy link
Member Author

Zalathar commented Nov 3, 2025

Rollup of everything not in #148412.

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Nov 3, 2025

📌 Commit c10e1e4 has been approved by Zalathar

It is now in the queue for this repository.

@bors bors 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 Nov 3, 2025
@bors
Copy link
Collaborator

bors commented Nov 3, 2025

⌛ Testing commit c10e1e4 with merge 7878a91...

@Zalathar
Copy link
Member Author

Zalathar commented Nov 3, 2025

If this rollup fails for any reason, please prefer to create a newer, larger rollup. No reason to retry this particular subset of PRs.

@bors
Copy link
Collaborator

bors commented Nov 3, 2025

☀️ Test successful - checks-actions
Approved by: Zalathar
Pushing 7878a91 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 3, 2025
@bors bors merged commit 7878a91 into rust-lang:master Nov 3, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 3, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#144194 Provide additional context to errors involving const traits 949baf3133f9742cadb3052ddd125689db6e89f1 (link)
#148232 ci: add runners for vanilla LLVM 21 c5262e25be0e7989a18e5c4f20510483b1409822 (link)
#148240 rustc_codegen: fix musttail returns for cast/indirect ABIs 6ac183251fdef6f35336a9604f49ca65b3b6417b (link)
#148247 Remove a special case and move another one out of reachable… 6c0c58f00086ee4deeeb3d8eee6e16cc25a3e926 (link)
#148370 Point at inner item when it uses generic type param from ou… 0ce76d8861244de42a0552032ee7aed51acaef96 (link)

previous master: c5dabe8cf7

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
Contributor

github-actions bot commented Nov 3, 2025

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 c5dabe8 (parent) -> 7878a91 (this PR)

Test differences

Show 46 test diffs

Stage 1

  • [ui] tests/ui/explicit-tail-calls/become-cast-return.rs: [missing] -> pass (J0)
  • [ui] tests/ui/explicit-tail-calls/become-indirect-return.rs: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/explicit-tail-calls/become-cast-return.rs: [missing] -> pass (J1)
  • [ui] tests/ui/explicit-tail-calls/become-indirect-return.rs: [missing] -> pass (J1)
  • [ui] tests/ui/explicit-tail-calls/become-cast-return.rs: [missing] -> ignore (ignored when cross-compiling) (J2)
  • [ui] tests/ui/explicit-tail-calls/become-indirect-return.rs: [missing] -> ignore (ignored when cross-compiling) (J2)
  • [ui] tests/ui/explicit-tail-calls/become-cast-return.rs: [missing] -> ignore (gcc backend is marked as ignore) (J3)
  • [ui] tests/ui/explicit-tail-calls/become-indirect-return.rs: [missing] -> ignore (gcc backend is marked as ignore) (J3)

Additionally, 38 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 7878a919448eb219b630d1866ca06c0d412483f2 --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. pr-check-1: 1497.2s -> 1918.7s (+28.1%)
  2. pr-check-2: 2735.1s -> 2332.1s (-14.7%)
  3. dist-x86_64-windows-gnullvm: 5308.3s -> 4588.1s (-13.6%)
  4. dist-aarch64-msvc: 5271.4s -> 5980.3s (+13.4%)
  5. x86_64-gnu-llvm-20-2: 5951.2s -> 5254.5s (-11.7%)
  6. dist-apple-various: 3490.3s -> 3871.7s (+10.9%)
  7. dist-i686-linux: 6645.7s -> 5977.8s (-10.1%)
  8. dist-various-1: 3991.3s -> 4347.6s (+8.9%)
  9. dist-x86_64-apple: 5622.9s -> 6097.9s (+8.4%)
  10. dist-x86_64-musl: 7852.1s -> 7207.9s (-8.2%)
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.

@Zalathar Zalathar deleted the rollup-1rrbzk7 branch November 3, 2025 06:51
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7878a91): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.8%, 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.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
0.7% [0.7%, 0.7%] 1
Improvements ✅
(primary)
-5.4% [-8.6%, -2.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.8% [-8.6%, 2.4%] 3

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 474.179s -> 475.242s (0.22%)
Artifact size: 390.90 MiB -> 390.89 MiB (-0.00%)

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-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc F-explicit_tail_calls `#![feature(explicit_tail_calls)]` merged-by-bors This PR was explicitly merged by bors. 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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants