Skip to content

Rollup of 4 pull requests - #161799

Closed
jhpratt wants to merge 17 commits into
rust-lang:mainfrom
jhpratt:rollup-HDbHR4e
Closed

Rollup of 4 pull requests#161799
jhpratt wants to merge 17 commits into
rust-lang:mainfrom
jhpratt:rollup-HDbHR4e

Conversation

@jhpratt

@jhpratt jhpratt commented Aug 26, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

ettolrach and others added 17 commits August 24, 2026 13:06
Due to some bad ordering of session/config initialization code -- more
about that in subsequent commits -- `cfg(target_has_threads)` fails to
be set for the `wasm32-unknown-unknown` platform when
`-Ctarget-feature=+atomics` is specified. This commit modifies a test to
demonstrate the bug; as written the test passes.
- `parse_check_cfg` has a single call site and is followed by
  a call to `fill_well_known`.

- `parse_cfg` has two call sites and in both cases is followed by
  a call to `build_configuration`.

This commit moves the follow-up calls into the functions, simplifying
`run_compiler`.
Currently it modifies the `Session` and the `Cfg` (and the `Cfg`
afterwards is put into the `Session`). It also takes a `CodegenBackend`.
Those are some heavyweight arguments.

This commit moves the `Session` modifications to the caller so the `&mut
Session` isn't necessary, and passes in the `TargetConfig` instead of
the whole `CodegenBackend`, plus some other small arguments.
`add_configuration` ends up more clearly about modifying the `Cfg`. This
is a step towards untangling session/backend initialization.
Currently, `parse_cfg` calls `build_configuration`, which calls
`default_configuration`, which calls
`sess.target.singlethread(&sess.internal_target_features)`. But
`sess.internal_target_features` hasn't been set at this point and is
empty!

This commit moves the setting of `sess.internal_target_features` before
the `parse_cfg` call to fix this ordering bug. This results in the
`cfg(target_has_threads)` being correctly set on
`wasm32-unknown-unknown` when `-Ctarget-feature=+atomics` is specified.

Note: I have plans to make this kind of ordering bug
difficult/impossible in a follow-up (e.g. rust-lang#161432).
`RawSpan`, `RawDefId`, and `RawDefPathHash` were all introduced to work
around the fact that `StableHashCtxt` in `rustc_data_structure` is
upstream of `rustc_span`. However, `DefPathHash` is just a newtype
around `Fingerprint`, which is defined  in `rustc_data_structure`. So by
working directly with `Fingerprint` we can remove `RawDefPathHash`,
which is a nice simplification.
had to update several tests which used repeated aligns and packeds. they
now produce both a warning and an error where appropriate (e.g. when
using conflicting packeds) which i think is correct.
… r=jdonszelmann

lint against repeated repr attributes

fixes rust-lang#156029 by adding a lint against repeated repr attributes.

r? scottmcm
Fix the wasm32-unknown-unknown target feature/cfg bug

Due to some bad ordering of session/config initialization code, `cfg(target_has_threads)` fails to be set for the `wasm32-unknown-unknown` platform when `-Ctarget-feature=+atomics` is specified. This PR fixes the problem. Details in individual commits.

r? @Mark-Simulacrum
…ee1-dead

Remove `RawDefPathHash`

`RawSpan`, `RawDefId`, and `RawDefPathHash` were all introduced to work around the fact that `StableHashCtxt` in `rustc_data_structure` is upstream of `rustc_span`. However, `DefPathHash` is just a newtype around `Fingerprint`, which is defined  in `rustc_data_structure`. So by working directly with `Fingerprint` we can remove `RawDefPathHash`, which is a nice simplification.

r? @fee1-dead
explicitly state that allocations cannot grow to the left

This was already implied, but it seems better to make this explicit.

Cc @rust-lang/opsem
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 26, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs 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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 26, 2026
@jhpratt

jhpratt commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@rust-bors

rust-bors Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4162d41 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. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2026
@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 Aug 26, 2026
@rust-bors

rust-bors Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants