Skip to content

Rollup of 9 pull requests #143116

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 29 commits into from
Jun 28, 2025
Merged

Rollup of 9 pull requests #143116

merged 29 commits into from
Jun 28, 2025

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Jun 27, 2025

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bend-n and others added 29 commits June 25, 2025 01:12
rustc_std_internal_symbol is meant to call functions from crates where
there is no direct dependency on said crate. As they either have to be
added to symbols.o or rustc has to introduce an implicit dependency on
them to avoid linker errors. The latter is done for some things like the
panic runtime, but adding these symbols to symbols.o allows removing
those implicit dependencies.
This used to be necessary for a correct linker order, but ever since the
introduction of symbols.o adding the symbols in question to symbols.o
would work just as well. We do still add dependencies on the panic runtime
to the local crate, but not for #![needs_panic_runtime] crates.

This also removes the runtime-depends-on-needs-runtime test.
inject_dependency_if used to emit this error, but with symbols.o it is
no longer important that there is no dependency and in fact it may be
nice to have panic_abort and panic_unwind directly depend on libstd in
the future for calling std::process::abort().
You shouldn't ever need to explicitly depend on it. And we weren't
checking that the panic runtime used the correct panic strategy either.
There is already panic-unwind to enable it.
…=fee1-dead

New const traits syntax

This PR only affects the AST and doesn't actually change anything semantically.

All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser

Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error

r? ``@fee1-dead``

cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
…trochenkov

Reduce special casing for the panic runtime

See the individual commits for more info.
…hen_file_found_but_module_not_defined, r=petrochenkov

suggest declaring modules when file found but module not defined

suggests declaring modules when a module is found but not defined, i.e
```
├── main.rs: `use thing::thang;`
└── thing.rs: `struct thang`
```
or
```
├── main.rs: `use thing::thang;`
└── thing
    └── mod.rs: `struct thang`
```
which currently is just
```rust
error[E0432]: unresolved import `yeah`
 --> src/main.rs:1:1
  |
1 | use thing::thang;
  |     ^^^^^ use of unresolved module or unlinked crate `thing`
  |
```
but now would have this nice help:
```text
= help: you may have forgotten to declare the module `thing`. use `mod thing` in this file to declare this module.
```
…lcnr,BoxyUwU

Normalize before computing ConstArgHasType goal in new solver

This is a fix for rust-lang#139905. See the description I left in the test.

I chose to fix this by normalizing the type before matching on its `.kind()` in `compute_const_arg_has_type_goal` (since it feels somewhat consistent with how we normalize types before assembling their candidates, for example); however, there are several other solutions that come to mind for fixing this ICE:
1. (this solution)
2. Giving `ConstKind::Error` a proper type, like `ConstKind::Value`, so that consts don't go from failing to passing `ConstArgHasType` goals after normalization (i.e. `UNEVALUATED` would normalize into a `ConstKind::Error(_, bool)` type rather than losing its type altogether).
3. Just suppressing the errors and accepting the fact that goals can go from fail->pass after normalization.

Thoughts? Happy to discuss this fix further.

r? `@BoxyUwU`
…li-obk

const validation: properly ignore zero-sized UnsafeCell

Fixes rust-lang#142948
r? `@oli-obk`
… r=oli-obk

const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology

This error recently got changed in rust-lang#140942 to use the terminology of "top-level scope", but after further discussion in rust-lang/reference#1865 it seems the reference will not be using that terminology after all. So let's also remove it from the compiler again, and let's focus on what actually happens with these temporaries: their lifetime is extended until the end of the program.

r? ``@oli-obk`` ``@traviscross``
…sized-deny, r=compiler-errors

hir_analysis: prohibit `dyn PointeeSized`

Fixes rust-lang#142652
Supersedes rust-lang#142663

`dyn PointeeSized` is nonsensical as a `dyn PointeeSized` needs to be `MetaSized`, so lets reject it to avoid hitting code paths that expect a builtin impl for `PointeeSized`

r? `@compiler-errors`
…BoxyUwU

gce: don't ICE on non-local const

Fixes rust-lang#133808

I have absolutely no idea what I'm doing here, but I followed `@BoxyUwU` 's [instructions](rust-lang#133808 (comment)), and turns out this small change fixes rust-lang#133808, and doesn't seem to break anything else.
(This code path is only reachable when the GCE feature gate is enabled, so even if it does break in a way that is not caught by current test coverage, I guess it's not as bad as breaking stable or non-incomplete features?)

Anyways, r? `@BoxyUwU` , if you don't mind.
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Jun 27, 2025
@rustbot rustbot added A-tidy Area: The tidy tool 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-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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jun 27, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit 0e79b89 has been approved by matthiaskrgr

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 Jun 27, 2025
@bors
Copy link
Collaborator

bors commented Jun 27, 2025

⌛ Testing commit 0e79b89 with merge d41e12f...

@bors
Copy link
Collaborator

bors commented Jun 28, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing d41e12f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 28, 2025
@bors bors merged commit d41e12f into rust-lang:master Jun 28, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 28, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#139858 New const traits syntax 1b800ef451336fdaa68a03c3a02c077e3998dd5b (link)
#140809 Reduce special casing for the panic runtime e7c43787574c6c29279007171329037307ccb8fd (link)
#142730 suggest declaring modules when file found but module not de… 470c2ca37c144f19e95e3e2e21a4d9817f560f76 (link)
#142806 Normalize before computing ConstArgHasType goal in new solv… 92c9dc00f2e23aa7f6a1c630f5de6e3336802479 (link)
#143046 const validation: properly ignore zero-sized UnsafeCell 099e0f1a60140f1c024e219ecb023c9f4b73349f (link)
#143092 const checks for lifetime-extended temporaries: avoid 'top-… 97523f951ab0dabe50f234180396d36fc9dc7479 (link)
#143096 tag_for_variant: properly pass TypingEnv cde0b1a42718a283eb054351941544a977b62665 (link)
#143104 hir_analysis: prohibit dyn PointeeSized 69b2e27a3fc8c0257fe130154dfa8482711409a4 (link)
#143106 gce: don't ICE on non-local const b80b791d7ff3ab892d72cddd46fa6f1dc9fc9759 (link)

previous master: bdaba05a95

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

Copy link
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 bdaba05 (parent) -> d41e12f (this PR)

Test differences

Show 72 test diffs

Stage 1

  • [crashes] tests/crashes/133808.rs: pass -> [missing] (J1)
  • [ui] tests/ui/const-generics/generic_const_exprs/non-local-const.rs: [missing] -> pass (J1)
  • [ui] tests/ui/consts/normalize-before-const-arg-has-type-goal.rs: [missing] -> pass (J1)
  • [ui] tests/ui/consts/unsafe_cell_in_const.rs: [missing] -> pass (J1)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/submodule/mod.rs: [missing] -> ignore (ignored used by another main test file) (J1)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/submodule2.rs: [missing] -> ignore (ignored used by another main test file) (J1)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/success.rs: [missing] -> ignore (ignored used by another main test file) (J1)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/suggestion.rs: [missing] -> pass (J1)
  • [ui] tests/ui/panic-runtime/runtime-depend-on-needs-runtime.rs: pass -> [missing] (J1)
  • [ui] tests/ui/sized-hierarchy/reject-dyn-pointeesized.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/call-const-in-conditionally-const.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/call-const-in-tilde-const.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/conditionally-const-and-const-params.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/conditionally-const-assoc-fn-in-trait-impl.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/conditionally-const-in-struct-args.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/conditionally-const-inherent-assoc-const-fn.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/conditionally-const-invalid-places.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/conditionally-const-trait-bound-assoc-tys.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/conditionally-const-trait-bound-syntax.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/duplicate-constness.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/impl-conditionally-const-trait.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/impl-tilde-const-trait.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/specialization/issue-95186-specialize-on-tilde-const.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/specialization/specialize-on-conditionally-const.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/tilde-const-and-const-params.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/tilde-const-assoc-fn-in-trait-impl.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/tilde-const-in-struct-args.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/tilde-const-inherent-assoc-const-fn.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/tilde-const-invalid-places.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/tilde-const-syntax.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/tilde-const-trait-assoc-tys.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/const-traits/tilde-twice.rs: pass -> [missing] (J1)

Stage 2

  • [ui] tests/ui/const-generics/generic_const_exprs/non-local-const.rs: [missing] -> pass (J0)
  • [ui] tests/ui/consts/normalize-before-const-arg-has-type-goal.rs: [missing] -> pass (J0)
  • [ui] tests/ui/consts/unsafe_cell_in_const.rs: [missing] -> pass (J0)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/submodule/mod.rs: [missing] -> ignore (ignored used by another main test file) (J0)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/submodule2.rs: [missing] -> ignore (ignored used by another main test file) (J0)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/success.rs: [missing] -> ignore (ignored used by another main test file) (J0)
  • [ui] tests/ui/modules/module_suggestion_when_module_not_found/suggestion.rs: [missing] -> pass (J0)
  • [ui] tests/ui/panic-runtime/runtime-depend-on-needs-runtime.rs: pass -> [missing] (J0)
  • [ui] tests/ui/sized-hierarchy/reject-dyn-pointeesized.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/call-const-in-conditionally-const.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/call-const-in-tilde-const.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/conditionally-const-and-const-params.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/conditionally-const-assoc-fn-in-trait-impl.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/conditionally-const-in-struct-args.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/conditionally-const-inherent-assoc-const-fn.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/conditionally-const-invalid-places.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/conditionally-const-trait-bound-assoc-tys.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/conditionally-const-trait-bound-syntax.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/duplicate-constness.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/impl-conditionally-const-trait.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/impl-tilde-const-trait.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/specialization/issue-95186-specialize-on-tilde-const.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/specialization/specialize-on-conditionally-const.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/const-traits/tilde-const-and-const-params.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/tilde-const-assoc-fn-in-trait-impl.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/tilde-const-in-struct-args.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/tilde-const-inherent-assoc-const-fn.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/tilde-const-invalid-places.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/tilde-const-syntax.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/tilde-const-trait-assoc-tys.rs: pass -> [missing] (J0)
  • [ui] tests/ui/traits/const-traits/tilde-twice.rs: pass -> [missing] (J0)
  • [crashes] tests/crashes/133808.rs: pass -> [missing] (J2)

Additionally, 8 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 d41e12f1f4e4884c356f319b881921aa37040de5 --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. dist-apple-various: 7695.8s -> 6107.5s (-20.6%)
  2. i686-gnu-2: 5446.1s -> 6282.9s (15.4%)
  3. x86_64-apple-1: 7903.6s -> 6732.2s (-14.8%)
  4. mingw-check-tidy: 69.4s -> 79.6s (14.6%)
  5. mingw-check-1: 1563.0s -> 1784.0s (14.1%)
  6. dist-aarch64-apple: 5475.2s -> 6203.2s (13.3%)
  7. dist-armv7-linux: 5379.4s -> 4708.0s (-12.5%)
  8. aarch64-gnu-debug: 3641.3s -> 4037.6s (10.9%)
  9. x86_64-gnu-tools: 3253.0s -> 3586.0s (10.2%)
  10. i686-gnu-nopt-1: 7285.0s -> 8017.5s (10.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
Collaborator

Finished benchmarking commit (d41e12f): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.1% [0.9%, 1.3%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.9%, secondary 2.6%)

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

mean range count
Regressions ❌
(primary)
2.9% [1.7%, 4.1%] 2
Regressions ❌
(secondary)
2.6% [2.1%, 3.4%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.9% [1.7%, 4.1%] 2

Cycles

Results (secondary -1.7%)

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

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

Binary size

Results (primary 0.0%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 14
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 28
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 14

Bootstrap: 689.13s -> 690.233s (0.16%)
Artifact size: 372.04 MiB -> 372.05 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 28, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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-compiler Relevant to the compiler 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. 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.