Skip to content

Rollup of 8 pull requests#157020

Open
GuillaumeGomez wants to merge 19 commits into
rust-lang:mainfrom
GuillaumeGomez:rollup-gTmS0AJ
Open

Rollup of 8 pull requests#157020
GuillaumeGomez wants to merge 19 commits into
rust-lang:mainfrom
GuillaumeGomez:rollup-gTmS0AJ

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Randl and others added 19 commits May 10, 2026 13:45
156229 didn't limit the additional DLL copy to Windows as it was
supposed to.
…=Zalathar

coverage: Use original HIR info for synthetic by-move coroutine bodies

> This is a copy of rust-lang#156952(because my git was acting weird)

Synthetic by-move coroutine bodies created for async closures don't have useful HIR of their own. Coverage was falling back to the parent async closure for HIR info, which means the executed `AsyncFnOnce` body could inherit hole spans from the wrong body and report the user-written closure body as uncovered.

This PR uses the synthetic body's coroutine type to recover the original coroutine body def-id, then extracts HIR info from that body instead. That keeps the coverage spans tied to the body the synthetic MIR was cloned from.

Fixes rust-lang#151135.

r? Zalathar
Constify Iterator-related methods and functions

These functions are required to eventually constify `Iterator`

r? @oli-obk
…=GuillaumeGomez

rustdoc: deterministic sorting for `doc_cfg` badges

Fixes rust-lang#156391

Currently, target-exclusive `doc_cfg` badges (eg. "Available on...") reuse the order of predicates as they appear in the source code. This often buries popular targets behind niche ones and leads to inconsistent UI rendering.

This PR introduces a deterministic sorting mechanism to the `Cfg` AST prior to HTML/JSON rendering.

**Note for Reviewers:**
To provide the best UX, I implemented a lightweight tiering heuristic (prioritizing major platforms like Linux/Apple/Windows first, followed by mobile, then BSDs, and alphabetizing the rest). However, I am completely open to tweaking these priority groupings or falling back to a different sorting logic if the team prefers. Let me know what you think!
…r=JohnTitor

Clarify "infinite size" in cyclic-type diagnostic refers to the type name

Closes rust-lang#149842

The `TypeError::CyclicTy` diagnostic currently emits
"cyclic type of infinite size". As discussed in the issue, "infinite
size" reads as the in-memory `size_of::<T>()` of values, when it
actually refers to the textual representation of the type name (an
iso-recursive occurs-check failure).

This rewords the message so the qualifier "infinite-size" clearly
modifies the *name*, matching the direction `@fmease`, `@BoxyUwU`,
and the issue author converged on:

```
- cyclic type of infinite size
+ recursive type with infinite-size name
```

Nine existing UI `.stderr` baselines and two `//~ NOTE` annotations
are updated to track the new wording. No semantics change.

Tested:
- ./x test tests/ui/const-generics/occurs-check/ tests/ui/closures/ tests/ui/unboxed-closures/ tests/ui/typeck/ tests/ui/coroutine/ --force-rerun
- ./x test tidy
…nethercote

Add uwtable annotation to modules when required

When unwind tables are enabled with `-Cforce-unwind-tables=y`, Rust will annotate all functions with the `uwtable` annotation. However, this annotation is missing on modules, which leads to incorrect unwind tables being generated by LLVM for constructors (such as `asan.module_ctor`).

This was discovered because it leads to a crash in Linux when KASAN and dynamic shadow call stack are both enabled. In this scenario, the kernel uses the unwind tables to locate the `paciasp` and `autiasp` instructions in each function and patches the machine code at boot to use the shadow call stack instructions instead. However, LLVM's AArch64PointerAuth pass emits DWARF info for `paciasp` whenever `-g` is passed, but only emits DWARF info for `autiasp` when the `uwtable` attribute is present. Since the `uwtable` annotation is missing for modules, the relevant directives are generated for only the `autiasp` instruction in `asan.module_ctor`, and not for the `paciasp` instruction. This causes the kernel's dynamic SCS logic to patch the prolouge of `asan.module_ctor`, but not the epilogue. This leads to a crash as the shadow call stack becomes unbalanced.

The fact that LLVM doesn't use the same condition for whether to emit DWARF information for both instructions may be a separate bug in LLVM.

Relevant issue: llvm/llvm-project#188234

AI assistance was used to determine the root cause of this crash from the observed symptoms, and to write the tests. Also thanks to @samitolvanen and @maurer for debugging this issue.

Similar to this previous PR of mine: rust-lang#130824
…s-only, r=jieyouxu

Limit the additional DLL to Windows

rust-lang#156229 didn't limit the additional DLL copy to Windows as it was supposed to.
…li-obk

interpret/validity: properly treat zero-variant enums so that we do not have to check layout.is_uninhabited

I am very happy to finally remove the last of these somewhat ad-hoc checks. :)

r? @oli-obk
std: Fix thread::available_parallelism on Redox targets

This brings support to `thread::available_parallelism` on Redox targets via `sysconf`. It has been available since `libc 0.2.177` and tested for months.

References:
- [libc implementation](rust-lang/libc#4728)
- [downstream patch](https://gitlab.redox-os.org/redox-os/rust/-/merge_requests/27)
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 27, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 27, 2026
@GuillaumeGomez
Copy link
Copy Markdown
Member Author

@bors r+ p=5 rollup=never

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 27, 2026

📌 Commit 45ed9ce has been approved by GuillaumeGomez

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 May 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 27, 2026
Rollup of 8 pull requests

Successful merges:

 - #156970 (coverage: Use original HIR info for synthetic by-move coroutine bodies)
 - #156390 (Constify Iterator-related methods and functions)
 - #156401 (rustdoc: deterministic sorting for `doc_cfg` badges)
 - #156845 (Clarify "infinite size" in cyclic-type diagnostic refers to the type name)
 - #156973 (Add uwtable annotation to modules when required)
 - #156985 (Limit the additional DLL to Windows)
 - #156988 (interpret/validity: properly treat zero-variant enums so that we do not have to check layout.is_uninhabited)
 - #157002 (std: Fix thread::available_parallelism on Redox targets)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 27, 2026

💔 Test for 9178026 failed: CI. Failed job:

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-msvc-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [rustdoc-html] tests\rustdoc-html\doc-cfg\sort.rs stdout ----
------python3.exe stdout------------------------------

------python3.exe stderr------------------------------
6: has check failed
 File does not exist 'foo\\fn.foo.html'
 //@ has 'foo/fn.foo.html'
7: has check failed
 File does not exist 'foo\\fn.foo.html'
 //@ has - '//*[@class="stab portability"]' 'Available on Android or Apple or Cygwin or DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD or QNX Neutrino only.'

Encountered 2 errors

------------------------------------------

error: htmldocck failed!
status: exit code: 1
command: "C:\\hostedtoolcache\\windows\\Python\\3.13.13\\arm64\\python3.exe" "C:\\a\\rust\\rust\\src/etc/htmldocck.py" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\rustdoc-html\\doc-cfg\\sort" "C:\\a\\rust\\rust\\tests\\rustdoc-html\\doc-cfg\\sort.rs"
stdout: none
--- stderr -------------------------------
6: has check failed
 File does not exist 'foo\\fn.foo.html'
 //@ has 'foo/fn.foo.html'
7: has check failed
 File does not exist 'foo\\fn.foo.html'
 //@ has - '//*[@class="stab portability"]' 'Available on Android or Apple or Cygwin or DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD or QNX Neutrino only.'

Encountered 2 errors
------------------------------------------

---- [rustdoc-html] tests\rustdoc-html\doc-cfg\sort.rs stdout end ----

failures:
    [rustdoc-html] tests\rustdoc-html\doc-cfg\sort.rs

test result: FAILED. 794 passed; 1 failed; 7 ignored; 0 measured; 13 filtered out; finished in 298.04s

Some tests failed in compiletest suite=rustdoc-html mode=rustdoc-html host=aarch64-pc-windows-msvc target=aarch64-pc-windows-msvc
Bootstrap failed while executing `test --stage 2 --skip=compiler --skip=src`
Build completed unsuccessfully in 1:28:45
make: *** [Makefile:115: ci-msvc-py] Error 1
  local time: Wed May 27 17:44:26 CUT 2026
  network time: Wed, 27 May 2026 17:44:26 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

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

Labels

rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.