Skip to content

Rollup of 11 pull requests - #161769

Closed
JonathanBrouwer wants to merge 51 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Lz4vAkJ
Closed

Rollup of 11 pull requests#161769
JonathanBrouwer wants to merge 51 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Lz4vAkJ

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Dnreikronos and others added 30 commits August 21, 2026 14:42
Generalize the recovery to match arguments positionally against the
generic parameters, skipping those that need no explicit argument:
elided early-bound lifetimes, synthetic `impl Trait` type parameters,
and trailing type parameters with defaults. Bail only when there are
more arguments than can be matched.

Omitting such a parameter leaves fewer arguments than parameters, so the
exact-count check made recovery feed `{type error}` for the anon const
while the real lowering later fed the true type, tripping a double-feed
ICE under the `-Zthreads=0` front-end race.
Each exercises the early `type_of` query under the `-Zthreads=0`
front-end race with an omittable generic parameter: a synthetic
`impl Trait` param, an elided early-bound lifetime, multiple explicit
args, and a defaulted trailing type parameter.
`needs_coroutine_by_move_body_def_id` asks for `type_of`, and for a body
owner nested inside a const argument's anon const that goes through
`typeck` of the anon const, which needs the anon const's own type. That
type is never computed, only fed while the enclosing body is
type-checked.

Asking for it in the same pass that type-checks the bodies lets the
parallel front end reach the nested body owner first, computing and
caching an error type for the anon const that then conflicts with the
type fed later on. Since nothing reports an error in that case, the
delayed bugs surface as an ICE.

Split it into a second pass over the body owners so every body has been
type-checked, and every const argument lowered, before any nested body
owner is asked for its type.
Recovering the type from the HIR path meant re-deriving what the generic
argument lowering already works out, and only covered the cases the
partial classifier recognized: free function paths resolved to
`DefKind::Fn`, with no late-bound lifetimes.

Anything else still cached an error type and tripped the double-feed
ICE, including associated functions, tuple struct constructors, inherent
type-relative paths, and const arguments in type annotations, which are
not path expressions at all and so cannot be classified this way.

With the by-move bodies generated after typeck the anon const's type is
always fed before anything asks for it, so drop the recovery along with
the tests that only exercised its argument counting. The shapes they
covered are folded into the main regression test.
A naive `f32::mul_add(a as f32, b as f32, c as f32) as f16` has insufficient precision
…when-reliable

run `f16` and `f128` tests natively when reliable
port all variadic functions to strict signature checking
These non-obvious things are worth documenting.
run _Unwind_RaiseException test on Windows
unify shim_sig and shim_sig_variadic macros
add internal DSL for testing binders

implements rust-lang/project-assumptions-on-binders#8

apologies to the inevitable swarm of people who get pinged for this...

basically the only interesting diff is `compiler/rustc_hir_analysis/src/check/wfcheck.rs`, which actually implements the test. there's probably still features we want to add to this DSL (e.g. `RegionConstraint::AliasTyOutlivesViaEnv`), and there might be some bugs lurking, but this is at least a base to work off of. It's perma-unstable and for internal use only, so support and quality doesn't have to be incredibly high. For example, parser recovery and whatnot is just, bad, but whatever.

r? BoxyUwU
…=nia-e

Add custom allocators to `(try_)map` on `Box`, `Rc`, `Arc`

Adds custom allocators to `(try_)map` on `Box`, `Rc`, `Arc`.

Not on `UniqueArc`/`UniqueRc` because too much allocator-related API is missing atm and I didn't want to end up writing unsound garbage. The `else` branch in those needs to drop a weakref, I'll get to that later.

cc rust-lang#160534

r? nia-e
Fix debugger visualizer tuple child ordering w/ PDB debug info

see: llvm/llvm-project#218613 for an explanation of the issue. tl;dr, PDB fields reflect rustc's reordering, whereas DWARF fields are in source-code-order. This causes issues with `GetChildAtIndex` in cases where both DWARF- and PDB-based types can interact with them.

This PR uses field names to retrieve field indexes, rather than blindly indexing into the field array.

I did a quick scan over the rest of the `GetChildAtIndex` calls, and they all fall under a few safe cases

1. in DWARF or PDB specific providers (mainly enum discriminants, which can't be reordered anyway)
2. used to get field `0` of a struct with only 1 field
3. in the summary provider where we're typically already interacting with the synthetic value and synthetic children anyway

cc rust-lang#161657, fixes `tests/debuginfo/tuple-struct.rs` on `windows-msvc`

<details><summary>`windows-msvc` `tests/debuginfo` results with this change</summary>

```
failures:
    [debuginfo-lldb] tests\debuginfo\associated-types.rs
    [debuginfo-lldb] tests\debuginfo\borrowed-basic.rs
    [debuginfo-lldb] tests\debuginfo\borrowed-unique-basic.rs
    [debuginfo-lldb] tests\debuginfo\basic-types-globals.rs#no-lto
    [debuginfo-lldb] tests\debuginfo\borrowed-tuple.rs
    [debuginfo-lldb] tests\debuginfo\boxed-struct.rs
    [debuginfo-lldb] tests\debuginfo\captured-fields-2.rs
    [debuginfo-lldb] tests\debuginfo\cross-crate-spans.rs
    [debuginfo-lldb] tests\debuginfo\coroutine-locals.rs
    [debuginfo-lldb] tests\debuginfo\box.rs
    [debuginfo-lldb] tests\debuginfo\captured-fields-1.rs
    [debuginfo-lldb] tests\debuginfo\c-style-enum-in-composite.rs
    [debuginfo-lldb] tests\debuginfo\by-value-self-argument-in-trait-impl.rs
    [debuginfo-lldb] tests\debuginfo\destructured-for-loop-variable.rs
    [debuginfo-lldb] tests\debuginfo\dummy_span.rs
    [debuginfo-lldb] tests\debuginfo\evec-in-struct.rs
    [debuginfo-lldb] tests\debuginfo\destructured-fn-argument.rs
    [debuginfo-lldb] tests\debuginfo\destructured-local.rs
    [debuginfo-lldb] tests\debuginfo\generic-struct.rs
    [debuginfo-lldb] tests\debuginfo\issue-22656.rs
    [debuginfo-lldb] tests\debuginfo\basic-types-globals.rs#lto
    [debuginfo-lldb] tests\debuginfo\lexical-scope-in-if.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scope-in-stack-closure.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scope-in-unconditional-loop.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scope-with-macro.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scope-in-unique-closure.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scope-in-if-let.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scopes-in-block-expression.rs
    [debuginfo-lldb] tests\debuginfo\method-on-generic-struct.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scope-in-while.rs
    [debuginfo-lldb] tests\debuginfo\lexical-scope-in-for-loop.rs
    [debuginfo-lldb] tests\debuginfo\name-shadowing-and-scope-nesting.rs
    [debuginfo-lldb] tests\debuginfo\no_mangle-info.rs
    [debuginfo-lldb] tests\debuginfo\packed-struct-with-destructor.rs
    [debuginfo-lldb] tests\debuginfo\pretty-slices.rs
    [debuginfo-lldb] tests\debuginfo\packed-struct.rs
    [debuginfo-lldb] tests\debuginfo\reference-debuginfo.rs
    [debuginfo-lldb] tests\debuginfo\simple-struct.rs
    [debuginfo-lldb] tests\debuginfo\simple-lexical-scope.rs
    [debuginfo-lldb] tests\debuginfo\shadowed-variable.rs
    [debuginfo-lldb] tests\debuginfo\simple-tuple.rs
    [debuginfo-lldb] tests\debuginfo\shadowed-argument.rs
    [debuginfo-lldb] tests\debuginfo\struct-with-destructor.rs
    [debuginfo-lldb] tests\debuginfo\strings-and-strs.rs
    [debuginfo-lldb] tests\debuginfo\struct-in-struct.rs
    [debuginfo-lldb] tests\debuginfo\pretty-std-collections.rs
    [debuginfo-lldb] tests\debuginfo\tuple-in-tuple.rs
    [debuginfo-lldb] tests\debuginfo\thread-names.rs#win
    [debuginfo-lldb] tests\debuginfo\vec-slices.rs
    [debuginfo-lldb] tests\debuginfo\var-captured-in-sendable-closure.rs
    [debuginfo-lldb] tests\debuginfo\var-captured-in-stack-closure.rs
    [debuginfo-lldb] tests\debuginfo\var-captured-in-nested-closure.rs

test result: FAILED. 244 passed; 52 failed; 223 ignored; 0 measured; 0 filtered out; finished in 13.22s
```
</details>
miri subtree update

I want to add proper vararg checks for Miri's shims but it turns out I'll have to adjust the rustc side for this. It'll be easier to just do the entire thing as a rustc patch, but that needs a sync first.

---

Subtree update of `miri` to rust-lang/miri@40000c5.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
make trivial ABI check resilient against new repr

There's currently no way to exhaustively match on "what basic `repr` is this", which is kind of fragile as it means a new repr will get whatever the `else` branch happens to be everywhere. Changing this would be a major refactor, but let's at least make it possible to `assert!` that we covered all the cases by adding an explicit way to check for `repr(Rust)`.
…ailable-suggestion, r=mu001999

Detect missing binding available: add a MaybeIncorrect suggestion

When suggesting that a missing binding is available in a pattern but not used, if it is behind a `..` suggest a MaybeIncorrect fix replacing `..` with `{binding}, ..`

This suggestion could be a `tool_only_suggestion`, or a `span_suggestion_hidden`. Other types of suggestions seem a bit too verbose for this simple case.
The `tool_only_suggestion` (first commit) does not add any suggestion in stderr, the `span_suggestion_hidden` (second commit) shows a minimal help line.

This work was extracted from PR rust-lang#156239.
…nded, r=tgross35

test `f16::mul_add` not double-rounding the result

test the precision of `f16::mul_add`. The semantics of `mul_add` are that there should only be one rounding of the final result back into the storage type, i.e. the intermediate result of the multiplication should not be rounded.

A naive implementation of `f16::mul_add` as `f32::mul_add(a as f32, b as f32, c as f32) as f16` has insufficient precision, see llvm/llvm-project#98389.

Our `rustc_codegen_gcc` backend still used the `f32` approach, this PR changes it to instead (implicitly) use the fallback body from `core`, which uses `f64::mul_add` so that the result is correctly rounded.
…ts, r=jdonszelmann

Add two comments relating to new-solver performance

These non-obvious things are worth documenting.

r? @jdonszelmann
Add codegen test for static table search loop unrolling

Adds a test for reported case in rust-lang#44041. The follow up case in that issue is still open so this does not close it
…=Kobzol

do not compress debuginfo for Cygwin

when I updated Rust for MSYS, I got errors from gcc regarding -Wl,--compress-debug-sections=zlib flag being unsupported. so don't add it for all Cygwin hosts

r? @Kobzol
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 25, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) PG-exploit-mitigations Project group: Exploit mitigations 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-clippy Relevant to the Clippy team. 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. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Aug 25, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@rust-bors

rust-bors Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b7aa4a7 has been approved by JonathanBrouwer

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

rust-bors Bot commented Aug 25, 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 (`#[…]`, `#![…]`) PG-exploit-mitigations Project group: Exploit mitigations 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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. T-rustfmt Relevant to the rustfmt 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.