Skip to content

Rollup of 12 pull requests#156207

Closed
jhpratt wants to merge 35 commits intorust-lang:mainfrom
jhpratt:rollup-0Q5NmBI
Closed

Rollup of 12 pull requests#156207
jhpratt wants to merge 35 commits intorust-lang:mainfrom
jhpratt:rollup-0Q5NmBI

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented May 5, 2026

Successful merges:

r? @ghost

Create a similar rollup

arjunr2 and others added 30 commits May 1, 2026 16:29
ci-llvm include paths were leaking into debuginfo of `librustc_driver` via C/C++ compilation in rustc_llvm, causing non-determinism across
stage2 builds.

extend debug path remapping to the C/C++ build in rustc_llvm by converting RUSTC_DEBUGINFO_MAP into corresponding -fdebug-prefix-map flags and passing them through cc::Build.
Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
This removes a separate call in the x86_64-gnu-llvm-21-3 job which runs
the ui-fulldeps a second time. ui-fulldeps is already running in the
first call (`../x.py --stage 1 test`) as it is a default test suite.

This was added in rust-lang#116009, but I
think that was a misunderstanding of the problem. The actual problem was
fixed in rust-lang#116932 where the actual
problem was the use of `&&`.

This doesn't really have much of an impact on CI time (only a couple
seconds) because all the tests are skipped with `ignored, up-to-date`.
I'm mainly doing this to clean up the script itself for clarity.
generic_const_args: allow paths to non type consts

tracking issue: rust-lang#151972

Non type consts should be usable in the type system in `feature(generic_const_args)`. These are directly plugged into the constant evaluator, unlike type consts, which are attempted to be reasoned about by the type system.

Inherent associated constants are not supported at this time, due to complications around how generic arguments are represented for them (it's currently a mess). The mess is being cleaned up (e.g. rust-lang#154758), so instead of trying to hack support in before the refactoring is done, let's just wait to be able to implement it more cleanly.

r? @BoxyUwU
Added command-line argument support for `wasm32-wali-linux-musl`
…trochenkov

Fewer global node_id_to_def_id lookups

Several of these are unnecessary if we track the `LocalDefId` together with the `NodeId`. We can't remove the `NodeId` entirely, as it is needed for lints, but it's a useful refactoring for splitting node_id_to_def_id into a per-owner table in the future

r? @petrochenkov
…xcrichton

Wasm: remove implicit `__heap_base`/`__data_end` exports

This is kind of a follow-up to rust-lang#147225. Currently `__heap_base`/`__data_end` globals are implicitly exported on `wasm*-unknown-unknown` and `wasm32v1-none`, even though they were only used for Wasm multi-threading, requiring the atomics target feature and shared memory.

Instead users should explicitly opt-in to these features, in which case toolchains, like `wasm-bindgen`, would require some linker flags. After this PR the following would be required for multi-threading support in `wasm-bindgen`:
```
-Clink-arg=--shared-memory -Clink-arg=--max-memory=1073741824 -Clink-arg=--import-memory -Clink-arg=--export=__heap_base -Clink-arg=--export=__wasm_init_tls -Clink-arg=--export=__tls_size -Clink-arg=--export=__tls_align -Clink-arg=--export=__tls_base
```

You will notice that the only new addition is `--export=__heap_base`, apparently `wasm-bindgen` doesn't need `__data_end` anymore (I didn't dig into the original motivation).

---

For context why `wasm-bindgen` needed access to `__heap_base`:
There is currently no mechanism in the Wasm tool conventions that automatically allocates the stack for every thread (e.g. via the `start` function). So `wasm-bindgen` has to explicitly call `malloc` to allocate the stack on the new thread.

However, calling `malloc` itself requires a stack to be present! With the help of `__heap_base` `wasm-bindgen` constructs a temporary stack to make this work. This is obviously quite hacky. A newer implementation could go a different route: e.g. allocate the threads stack in the main thread and passing the right information on, not requiring access to `__heap_base` at all (and avoiding this really messy workaround).

I should also note here that e.g. [`js-bindgen`](https://github.com/wasm-bindgen/js-bindgen), the successor currently being worked on, doesn't need any of these exports because it doesn't rely on post-processing. In which case all of these variables can be accessed by name at link-time, instead of requiring the linker to export each variable for post-processing to find them by name. That is to say: all these workaround are toolchain-specific and not universal to the Wasm targets.

---

r? @alexcrichton
…remap2, r=Urgau

fix: remap ci-llvm debug paths via `-ffile-prefix-map`

### problem:
ci-llvm include paths leak into debuginfo of `librustc_driver` via C/C++ compilation in `rustc_llvm` , causing non-determinism across two stage2 hermetic builds.

this exhibits as suffixes differing in `anon.*.llvm.<hash>` and mismatched GNU Build IDs, this persists even after stripping the debuginfo.
`remap-debuginfo` does not cover this, it only applies to rustc and not to C/C++ compiler.

### fix:
extend debug path remapping to the C/C++ build in `rustc_llvm` by converting `RUSTC_DEBUGINFO_MAP` into corresponding `-fdebug-prefix-map` flags and passing them through `cc::Build`.

**this is a targeted fix in rustc_llvm; a more general solution would involve propagating remap flags across rustc <-> cargo <-> build scripts.**

r? @Urgau
port `rustc_ast*` crates from `box_` to `deref_patterns`

Part of rust-lang#156110, this ports the first few crates away from `box_patterns` to `deref_patterns`.
Don't run ui-fulldeps tests twice in stage 1

This removes a separate call in the x86_64-gnu-llvm-21-3 job which runs the ui-fulldeps a second time. ui-fulldeps is already running in the first call (`../x.py --stage 1 test`) as it is a default test suite.

This was added in rust-lang#116009, but I think that was a misunderstanding of the problem. The actual problem was fixed in rust-lang#116932 where the actual problem was the use of `&&`.

This doesn't really have much of an impact on CI time (only a couple seconds) because all the tests are skipped with `ignored, up-to-date`. I'm mainly doing this to clean up the script itself for clarity.
jhpratt added 5 commits May 5, 2026 17:02
Always use `ConstFn` context for `const` closures

fixes rust-lang#155803

Since rust-lang@e8a4611, `hir_body_const_context()` returned the parent's const context for a `const` closure. But a `const` closure can escape its enclosing body via a `fn`-pointer-typed const item or an opaque return type and be invoked at runtime, so it must be const-checked under the most restrictive `ConstFn` context like a regular `const fn`.

r? oli-obk (since you authored the commit mentioned above, feel free to reroll)
interpret: correctly deal with repr(transparent) enums

Fixes rust-lang/miri#4998
Use `all_impls` instead of handrolling it

just found this while looking at other things
Adjust getMCSubtargetInfo signature for LLVM 23+

A recent [LLVM PR](llvm/llvm-project#195032) changed the signature of `getMCSubtargetInfo` to return a reference instead of a pointer. This adjusts uses of the function in `compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp` to account for the different signature.
move generalization test

The forth test of rust-lang/trait-system-refactor-initiative#191 (comment) isn't actually related to closure signature inference.

closes rust-lang/trait-system-refactor-initiative#191, which has already been fixed by rust-lang#155767

r? types
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 5, 2026
@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-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-linux Operating system: Linux 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. 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 May 5, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented May 5, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 5, 2026

📌 Commit 2a2d590 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. 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-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 5, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 5, 2026

☔ The latest upstream changes (presumably #156190) made this pull request unmergeable. Please resolve the merge conflicts.

This pull request was unapproved.

@jhpratt jhpratt closed this May 5, 2026
@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 May 5, 2026
@jhpratt jhpratt deleted the rollup-0Q5NmBI branch May 5, 2026 23:02
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-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-linux Operating system: Linux rollup A PR which is a rollup 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.