Skip to content

Rollup of 8 pull requests#158676

Merged
rust-bors[bot] merged 23 commits into
rust-lang:mainfrom
jhpratt:rollup-oGLvd9H
Jul 2, 2026
Merged

Rollup of 8 pull requests#158676
rust-bors[bot] merged 23 commits into
rust-lang:mainfrom
jhpratt:rollup-oGLvd9H

Conversation

@jhpratt

@jhpratt jhpratt commented Jul 1, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

vinDelphini and others added 23 commits June 13, 2026 15:18
Clarify that GuardBack initializes arrays from the end.

Restore performance note for iter_next_chunk_erased regarding optimization issues.
I copied the impl block from Guard without noticing that Destruct was only there for const contexts. Consumed the suggestion, thanks.

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
…troduced next_chunk_back implementation in IntoIter, updated documentation, and added test cases for DoubleEndedIterator::next_chunk_back
Add support for LoongArch LSX and LASX registers in inline assembly by
introducing the `vreg` and `xreg` register classes, along with their
associated vector types and operand modifiers. The new register classes
are gated behind the `asm_experimental_reg` feature. Also model the overlap
between FPU, LSX, and LASX registers so register conflict checking works
correctly for aliased registers.
Add UI tests for LoongArch LSX/LASX inline asm registers, including
target-feature gating and overlap diagnostics between `fN`, `vrN`, and
`xrN` registers.
Add assembly tests for LoongArch inline asm register modifiers. Verify
that the `w` and `u` modifiers correctly select LSX and LASX register
views for `freg`, `vreg`, and `xreg` operands and produce the expected
register names in the generated assembly.
Change HirId to its parent item LocalDefId.
We don't need any features from `twox-hash`, and in particular this
removes the last use of `rand v0.8` in our lock file.
## Fix struct links

There are several structs (`ExitStatus` and `ExitStatusError`) that could be linked, but aren't. Fixed. All links show their struct now instead of previously some showed `process::ExitStatus` when rendered.

## Add `wait` links

The docs distinguish `wait` as code, but do not link to **what** wait they're referring to. As this is Unix extension documentation, adding a link to the POSIX standard for `wait`. Showing a construction of an `ExitStatus` for both a signal and an exit code helps to highlight and internalize what **wait status, not an exit status** means.

## Example for `from_raw`

Current documentation calls out "The value should be a **wait status, not an exit status**." but it's unclear what exactly that means without a reference or an example. I added a doctest that shows you need to shift by 8 to get the desired result and annotated it with information about how that's derived based on the linked `wait` documentation.

## Example to `ExitStatus::signal`

Called out that a signaled process does not also produce an exit code. Added an example. Called out that just because a process reports that it was not terminated via a signal doesn't mean it never got one (it could be handled). Also added a note correlating shell behavior to exit codes:

GNU Bash manual: https://web.archive.org/web/20260625050034/https://www.gnu.org/software/bash/manual/bash.html#Exit-Status-1

> [...] a fatal signal whose number is N, Bash uses the value 128+N as the exit status.

FreeBSD bash(1) man page: https://man.freebsd.org/bash/1

> The return value	[...]  128+n  if the command is terminated by signal n.

## Panic scope on `from_raw`

This change is based on preference/experience:

When I originally read this documentation, it was because I clicked through `Output` -> `ExitStatus`. While the text "Creates a new `ExitStatus` or `ExitStatusError`" is present at the top, I didn't internalize what that meant exactly. Therefore, when I got to the panic section, I was mildly confused.

This edit makes the behavior more explicitly attached to the type. While the original format had all of the same information available, it was left for the reader to bridge that "making an ExitStatusError" is referring to `ExitStatus::from_raw` as that's the only constructor (for now).

Making this bridge more explicit also future-proofs us for future constructors (if they're ever added) that may or may not panic. While the context of the panic documentation is directly attached to `from_raw`, it's slightly (pedantically) more correct to not imply that ANY way of creating an ExitStatusError` from a `wait` of `0` will panic (a different constructor could perhaps return an option instead).

Technically, the syntax isn't correct, as it should be `<ExitStatusError as ExitStatusExt>::from_raw`, but I think this conveys intent without being overly verbose.

Co-authored-by: Colin Casey <casey.colin@gmail.com>
…xt_chunk_back, r=aapoalas

Implement `DoubleEndedIterator::next_chunk_back`

This PR builds off on @vinDelphini's [PR](rust-lang#151668) on introducing `DoubleEndedIterator::next_chunk_back` (which will be used in a follow up PR to optimize `ArrayChunks::try_rfold` once merged). This was in the works since late Jan and I thought to pick it up and get this over the finish line as vinDelphini has been away from the PR for a couple of months. I've made sure to pull from vinDelphini's branch to keep him authored on the commits he made.

Other things introduced from this PR is specialization like done for `Iterator::next_chunk`, constifying some stuff, making a custom `DoubleEndedIterator::next_chunk_back` for `IntoIter` (since it also has a custom impl of `Iterator::next_chunk`), and a bunch of tests mirroring that of `Iterator::next_chunk`.

There's no tracking issue for this yet, but the ACP for this introduction is [here](rust-lang/libs-team#734). I'll create the tracking issue for this soon.

----

Actually, can we have `DoubleEndedIterator::next_chunk_back` underneath [`Iterator::next_chunk` tracking issue](rust-lang#98326)?
std: use `OnceLock` for SGX environment variable storage

The SGX environment code predates the existence of `OnceLock` and `AtomicPtr` and consequently violates strict provenance. By using `OnceLock` we can remove all the `unsafe` code (except for the `unsafe` in the function signatures, that's required by other platforms).

CC @jethrogb @raoulstrackx @aditijannu
…d, r=aapoalas

Implement `ptr::{read,write}_unaligned` via `repr(packed)`

We already support doing unaligned reads & writes via `repr(packed)` fields, so this just uses that support from the backend rather than needing to thinks about `memcpy` and `intrinsics::forget` and such.

Turns out in codegen this ends up essentially identical because the packed type read gets `BackendRepr::Memory` and thus the read/write of the packed type *is* an `align 1` memcpy, just like the library code before this PR.  But doing this gives much simpler MIR and rust-lang#158291 will make it better than the previous version by not needing to emit the `memcpy` at all for things like `read_unaligned::<u32>`.

First commit are some tests that pass on master; Second commit changes the implementation and shows the corresponding test changes.

r? libs
…esleywiser

Change `adjust_ident_and_get_scope` arg to `LocalDefId`

Addresses a FIXME. Change a HirId to its owner LocalDefId.
…atus-ext, r=Darksonn

Clarify ExitStatusExt documentation

## Fix struct links

There are several structs (`ExitStatus` and `ExitStatusError`) that could be linked, but aren't. Fixed. All links show their struct now instead of previously some showed `process::ExitStatus` when rendered.

## Add `wait` links

The docs distinguish `wait` as code, but do not link to **what** wait they're referring to. As this is Unix extension documentation, adding a link to the POSIX standard for `wait`. Showing a construction of an `ExitStatus` for both a signal and an exit code helps to highlight and internalize what **wait status, not an exit status** means.

## Example for `from_raw`

Current documentation calls out "The value should be a **wait status, not an exit status**." but it's unclear what exactly that means without a reference or an example. I added a doctest that shows you need to shift by 8 to get the desired result and annotated it with information about how that's derived based on the linked `wait` documentation.

## Example to `ExitStatus::signal`

Called out that a signaled process does not also produce an exit code. Added an example. Called out that just because a process reports that it was not terminated via a signal doesn't mean it never got one (it could be handled). Also added a note correlating shell behavior to exit codes:

GNU Bash manual: https://web.archive.org/web/20260625050034/https://www.gnu.org/software/bash/manual/bash.html#Exit-Status-1

> [...] a fatal signal whose number is N, Bash uses the value 128+N as the exit status.

FreeBSD bash(1) man page: https://man.freebsd.org/bash/1

> The return value	[...]  128+n  if the command is terminated by signal n.

## Panic scope on `from_raw`

This change is based on preference/experience:

When I originally read this documentation, it was because I clicked through `Output` -> `ExitStatus`. While the text "Creates a new `ExitStatus` or `ExitStatusError`" is present at the top, I didn't internalize what that meant exactly. Therefore, when I got to the panic section, I was mildly confused.

This edit makes the behavior more explicitly attached to the type. While the original format had all of the same information available, it was left for the reader to bridge that "making an ExitStatusError" is referring to `ExitStatus::from_raw` as that's the only constructor (for now).

Making this bridge more explicit also future-proofs us for future constructors (if they're ever added) that may or may not panic. While the context of the panic documentation is directly attached to `from_raw`, it's slightly (pedantically) more correct to not imply that ANY way of creating an ExitStatusError` from a `wait` of `0` will panic (a different constructor could perhaps return an option instead).

Technically, the syntax isn't correct, as it should be `<ExitStatusError as ExitStatusExt>::from_raw`, but I think this conveys intent without being overly verbose.
…camelid

rustdoc: Show use-site paths for unevaluated const array lengths

After rust-lang#158171, I noticed a few additional issues with the rendering of consts in rustdoc. This PR fixes them. When rendering array lengths, avoid inlining the full definition of unevaluated constants via `print_inlined_const`. Instead, fall back to `Const::to_string()` for use-site rendering, matching the behavior already used for projections without bodies.

r? camelid
rustc_target/asm: add LoongArch LSX/LASX inline asm register support

Add support for LoongArch LSX and LASX registers in inline assembly by introducing the `vreg` and `xreg` register classes, along with their associated vector types and operand modifiers. The new register classes are gated behind the `asm_experimental_reg` feature. Also model the overlap between FPU, LSX, and LASX registers so register conflict checking works correctly for aliased registers.
rustc_sanitizers: use twox-hash without default features

We don't need any features from `twox-hash`, and in particular this
removes the last use of `rand v0.8` in our lock file.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 1, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-unix Operating system: Unix-like PG-exploit-mitigations Project group: Exploit mitigations 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 Jul 1, 2026
@rustbot rustbot added 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. labels Jul 1, 2026
@jhpratt

jhpratt commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a2f8a15 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 Jul 1, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 2, 2026
@rust-bors

rust-bors Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: jhpratt
Duration: 3h 25m 13s
Pushing 2371d69 to main...

@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#156737 Implement DoubleEndedIterator::next_chunk_back 45b46a6e8451af4d3feb5b0cfa0d06a28dee4fd8 (link)
#158180 std: use OnceLock for SGX environment variable storage 3f7d13ff5fb3d0191bfb8e117f8866ace0d1f430 (link)
#158427 Implement ptr::{read,write}_unaligned via repr(packed) e799d0d65f17f4553d6ce72699129d965f22a9b2 (link)
#158531 Change adjust_ident_and_get_scope arg to LocalDefId 4079f0690fbc0b0115f57e6eab53e28155fdedc4 (link)
#158574 Clarify ExitStatusExt documentation e29176941b0373535df1ad80fe6d863a7bb543d9 (link)
#158334 rustdoc: Show use-site paths for unevaluated const array le… a5258d6d24b083d74b5d858e30b9f5845cb612df (link)
#158364 rustc_target/asm: add LoongArch LSX/LASX inline asm registe… c8e69202e48e68b016e49618f3b2251952f85899 (link)
#158667 rustc_sanitizers: use twox-hash without default features 8a2899c5333925a701048f978d997057b9a992ba (link)

previous master: 4c9d2bfe4a

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

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
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 4c9d2bf (parent) -> 2371d69 (this PR)

Test differences

Show 192 test diffs

Stage 1

  • iter::adapters::filter::test_next_chunk_back_does_not_leak: [missing] -> pass (J5)
  • iter::traits::iterator::test_next_chunk_back: [missing] -> pass (J5)
  • iter::traits::iterator::test_next_chunk_back_untrusted: [missing] -> pass (J5)
  • [assembly] tests/assembly-llvm/asm/loongarch-modifiers.rs#loongarch32: [missing] -> pass (J6)
  • [assembly] tests/assembly-llvm/asm/loongarch-modifiers.rs#loongarch64: [missing] -> pass (J6)
  • [codegen] tests/codegen-llvm/read_write_unaligned.rs: [missing] -> pass (J6)
  • [mir-opt] tests/mir-opt/pre-codegen/unaligned.rs: [missing] -> ignore (ignored when std is built with debug assertions ((there's one in ptr::read))) (J6)
  • [rustdoc-html] tests/rustdoc-html/type-const-free-in-array.rs: [missing] -> pass (J6)
  • [rustdoc-html] tests/rustdoc-html/type-const-inherent-with-body.rs: [missing] -> pass (J6)
  • vec::test_into_iter_next_chunk_back: [missing] -> pass (J7)
  • [codegen] tests/codegen-llvm/read_write_unaligned.rs: [missing] -> ignore (only executed when the pointer width is 64bit) (J10)

Stage 2

  • iter::adapters::filter::test_next_chunk_back_does_not_leak: [missing] -> pass (J0)
  • iter::traits::iterator::test_next_chunk_back: [missing] -> pass (J0)
  • iter::traits::iterator::test_next_chunk_back_untrusted: [missing] -> pass (J0)
  • vec::test_into_iter_next_chunk_back: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/read_write_unaligned.rs: [missing] -> ignore (only executed when the pointer width is 64bit) (J1)
  • [assembly] tests/assembly-llvm/asm/loongarch-modifiers.rs#loongarch32: [missing] -> pass (J2)
  • [assembly] tests/assembly-llvm/asm/loongarch-modifiers.rs#loongarch64: [missing] -> pass (J2)
  • [rustdoc-html] tests/rustdoc-html/type-const-free-in-array.rs: [missing] -> pass (J3)
  • [rustdoc-html] tests/rustdoc-html/type-const-inherent-with-body.rs: [missing] -> pass (J3)
  • [codegen] tests/codegen-llvm/read_write_unaligned.rs: [missing] -> pass (J4)
  • [mir-opt] tests/mir-opt/pre-codegen/unaligned.rs: [missing] -> pass (J8)
  • [mir-opt] tests/mir-opt/pre-codegen/unaligned.rs: [missing] -> ignore (ignored when std is built with debug assertions ((there's one in ptr::read))) (J9)

Additionally, 169 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 2371d697abddba53be85137d5a68064066b4ae10 --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. x86_64-gnu-llvm-21-3: 1h 26m -> 1h 47m (+25.1%)
  2. i686-gnu-2: 1h 50m -> 1h 24m (-23.0%)
  3. x86_64-gnu-llvm-22-2: 1h 19m -> 1h 37m (+22.5%)
  4. i686-gnu-1: 2h 28m -> 1h 55m (-22.3%)
  5. dist-loongarch64-musl: 1h 51m -> 1h 28m (-20.1%)
  6. dist-loongarch64-linux: 1h 52m -> 1h 30m (-19.4%)
  7. tidy: 2m 56s -> 3m 26s (+16.7%)
  8. dist-apple-various: 1h 36m -> 1h 49m (+13.7%)
  9. aarch64-gnu-llvm-21-2: 39m 48s -> 35m 23s (-11.1%)
  10. x86_64-gnu-gcc: 1h 12m -> 1h 5m (-10.0%)
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
Copy Markdown
Collaborator

Finished benchmarking commit (2371d69): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

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)
- - 0
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 1

Max RSS (memory usage)

Results (primary -2.8%, secondary -0.1%)

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)
5.5% [2.5%, 9.4%] 3
Improvements ✅
(primary)
-2.8% [-3.4%, -2.3%] 2
Improvements ✅
(secondary)
-5.8% [-7.5%, -2.4%] 3
All ❌✅ (primary) -2.8% [-3.4%, -2.3%] 2

Cycles

Results (primary -2.1%)

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)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.1% [-2.1%, -2.1%] 1

Binary size

Results (primary -0.2%, secondary -0.3%)

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.1%] 2
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.3% [-0.5%, -0.1%] 7
Improvements ✅
(secondary)
-0.4% [-0.5%, -0.3%] 5
All ❌✅ (primary) -0.2% [-0.5%, 0.1%] 9

Bootstrap: 488.059s -> 486.119s (-0.40%)
Artifact size: 393.71 MiB -> 393.81 MiB (0.02%)

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

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.