Skip to content

Rustc pull update - #2203

Open
workflows-stdarch[bot] wants to merge 30 commits into
mainfrom
rustc-pull
Open

Rustc pull update#2203
workflows-stdarch[bot] wants to merge 30 commits into
mainfrom
rustc-pull

Conversation

@workflows-stdarch

Copy link
Copy Markdown

Latest update from rustc.

@rustbot

rustbot commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @adamgemmell (or someone else) some time within the next two weeks.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn
  • @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn expanded to Amanieu, adamgemmell, davidtwco, folkertdev, sayantn
  • Random selection from Amanieu, adamgemmell, davidtwco, folkertdev, sayantn

bors and others added 27 commits August 13, 2026 21:58
allocator: refactor for stabilisation

Adds my current proposal per the doc in rust-lang/rust#156882 and follow-up Zulip conversations (notably for [dyn-compat](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Allocator.20dyn-safety/near/599555822)) unstably.

r? libs
Rollup of 23 pull requests

Successful merges:

 - rust-lang/rust#157428 (allocator: refactor for stabilisation)
 - rust-lang/rust#158918 (x86_64-win: Enable f128 on LLVM 23+)
 - rust-lang/rust#160077 (Don't compute FnAbi for LLVM intrinsics)
 - rust-lang/rust#160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - rust-lang/rust#160440 (Couple of misc improvements to the unwind infrastructure)
 - rust-lang/rust#160896 (tidy: Update Python version requirements to 3.11)
 - rust-lang/rust#160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - rust-lang/rust#160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - rust-lang/rust#161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - rust-lang/rust#161037 (std: don't clean up the main thread's altstack)
 - rust-lang/rust#161040 (Optimize CStr backing slice bounds checks)
 - rust-lang/rust#161065 (core: Fix a typo in funnel shift documentation)
 - rust-lang/rust#158885 (Add `core::num::Complex`)
 - rust-lang/rust#160928 (check `mut`-restriction when tuple constructor is used as a value)
 - rust-lang/rust#160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - rust-lang/rust#161002 (disallow `#[cold]` on `extern "custom"` functions)
 - rust-lang/rust#161016 (Fix invalid suggestion from try unlabled block)
 - rust-lang/rust#161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - rust-lang/rust#161044 (rustc-dev-guide subtree update)
 - rust-lang/rust#161046 (Enable unrolling feature of bors)
 - rust-lang/rust#161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - rust-lang/rust#161055 (`offload!` function-like macro)
 - rust-lang/rust#161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
stop using fully_perform_locally with the next solver, it's worse (perf fix for unic-ucd)



r? @adwinwhite 



> [!NOTE]
> I've not used an LLM for any part of this PR, or any other PR I make. This includes any related work like research.
Avoid allocations when canonicalizing

Canonicalization is hot in the new solver. This commit avoids some allocations while doing it. Details in individual commits.

r? @lcnr
Convert `tests/debuginfo/pretty-std.rs` to `lldb-repr`



Two things of note:

* I had to fix another small issue with msvc template args
* Enabling this test on `windows-gnu` caused the GDB test to fail because GDB decodes the emoji to raw bytes when working with wtf-8 strings. There's not an easy way to handle wtf-8 in python i think? So i just replaced the emoji with a wildcard. The target-specific differences should also fix itself once `gdb-repr` is implemented

r? @jieyouxu, @Kobzol 

---

try-job: aarch64-apple*
try-job: aarch64-apple-macos-26*
…jgillot

Simplify `MaybeBorrowedLocals`

It is implemented as a `Visitor`, but it only uses `visit_statement`, `visit_terminator`, and `visit_rvalue`. Visiting statements and terminators is trivial without a `Visitor`, and visiting rvalues is almost as easy because they can only appear at the top-level of a `StatementKind::Assign`. So a `Visitor` is overkill, because we don't have to worry about nesting (like we would with expressions, for example).

So this commit restructures `MaybeBorrowedLocals` to not use a `Visitor`, which makes the analysis shorter and simpler. `gen_statement` and `gen_terminator` are added to do most of the work, and are called from several places. They are similar to the equivalent `visit_*` methods but `gen_statement` doesn't do any kills. So how are kills for statements handled?

- In `Self::apply_primary_statement_effect` we now explicitly kill (on a `StorageDead` stmt) after calling `gen_statement`.

- `borrowed_locals` doesn't do kills; in fact it currently has its own custom `GenKill` to avoid killing anything. So `gen_{statement,terminator}` are enough for it.

- `MaybeRequiresStorage::apply_early_statement_effect` already has an explicit kill. (I.e. it killed each local a second time, after calling the transfer function.)

r? @cjgillot
Assorted bootstrap LLVM refactors (part 2/N)

Continuation of rust-lang/rust#160645.

This PR removes dependence on implicit LLVM CI paths, and generally tries to make depending on various LLVM things more explicit wherever possible. One nice outcome of that is that we no longer override the LLVM config during config parsing when using `download-ci-llvm` 🎉 We also no longer dynamically download LLVM from CI when someone asks what is the LLVM linkage mode, lol (well, we still need to do it in a few places, but now at least it is explicit).

I tried to ensure that `x check compiler` does not build or even checkout the LLVM submodule. That being said, there might be some cases where calling `get_llvm_build_status` might now checkout the LLVM submodule (but it shouldn't happen for `x test mir-opt --bless`, which was fixed in rust-lang/rust#130918 - that PR introduced a boolean flag, but it was difficult to understand where it should be set to `false`/`true`).

The next thing after this is to try getting rid of the `llvm_out` function, though that will be probably quite painful. And also explicitly depending on the output of `LlvmFromCi`, rather than reading `llvm_ci_mode`.

I printed some step traces using commands like this:
```
BOOTSTRAP_TRACING=STEP=trace BOOTSTRAP_TRACING_SKIP_TIME=1 ./x build compiler 2> post-cg_default-build-compiler.txt
```
with this PR and on `main`.

The `BOOTSTRAP_TRACING_SKIP_TIME` thing was added in the first commit to make it easier to compare step traces. But later I realized that we should also normalize source code locations of the steps, otherwise if you modify something in a given file with the step, its location will change and it will perturb the diff. Anyway, I can drop the first commit if you want.

Best reviewed commit-by-commit (in fact I don't think it can be really reviewed in another way, lol).

r? jieyouxu
Upgrade and deduplicate dependencies



- Upgrade from `getrandom v0.4.2` to `v0.4.3` to drop its `wasip2` and
  `wasip3` dependencies and many transitives.
- Upgrade from `gimli v0.33` to `v0.34` as a direct dependency and
  through a `thorin-dwp` upgrade.
- Upgrade from `object v0.37` and `v0.38` to `v0.39` as a direct
  dependency and via `ar_archive_writer` and `thorin-dwp` upgrades.
- Upgrade `libloading` and `wasmparser` to match other dependencies.

This also consolidates from `hashbrown v0.15`, `v0.16`, and `v0.17` to
just `v0.17.1`, which is the same that `std` currently uses.
Overhaul `CoroutineKind`

Its structure is a bit weird. Details in individual commits.

r? @mejrs
Single-byte ASCII searcher for StrSearcherImpl(pattern.rs)

This adds a fast single-byte ASCII searcher using memchr. It will be useful when the user is searching for single ASCII tokens such as `\s`,`"`, `'`, `/`, `\n`, etc which are common usecase in many applications.

Benchmark results:
| Benchmark | Current stable | ByteNeedle PR | Δ |
|---|---|---|---|
| find_1byte_str_long_nomatch | 36,476 | 3,630 | **−90% (10.0×)** |
| find_1byte_str_long_match_end | 37,129 | 3,703 | **−90% (10.0×)** |
| rfind_1byte_str_long_nomatch | 35,653 | 3,542 | **−90% (10.1×)** |
| split_1byte_str_sparse | 40,289 | 14,555 | **−64% (2.8×)** |
| find_1byte_str_short_haystack | 16,970 | 8,140 | −52% (2.1×) |
| find_1byte_str_early_return | 16,860 | 10,571 | −37% (1.6×) |
| find_str | 6,265 | 5,630 | −10% |
| rfind_str | 5,623 | 5,206 | −7% |
| find_str_worst_case | 1,192 | 1,104 | −7% |
| split_char_dense | 39,598 | 37,823 | −4.5% |
| find_char_long_match_end | 3,766 | 3,625 | −3.7% |
| split_1byte_str_multibyte_haystack | 78,827 | 76,092 | −3.5% |
| find_char_short_haystack | 4,203 | 4,070 | −3% |
| find_char_long_nomatch | 3,726 | 3,629 | −2.6% |
| split_char_sparse | 13,128 | 12,927 | −1.5% |
| ends_with / starts_with (×4) | 272 | 275 | +1% |
| rfind_char_long_nomatch | 3,520 | 3,557 | +1% |
| rfind_str_worst_case | 27,056 | 27,432 | +1.4% |
| split_char_multibyte_haystack | 57,433 | 60,890 | **+6%** |
| split_1byte_str_dense | 45,841 | 52,936 | **+15%** |

r? joboet
Treat vars created for opaque subtyping as live everywhere

Fixes rust-lang/rust#160669

r? lqd

Let's look at a minimal variant of rust-lang/rust#160669

```rust
fn minimal(short: (), out: &'static ()) -> impl Sized {
    if true {
        return &short; //~ ERROR `short` does not live long enough
    }
    out
}
```

That has the following (simplified) MIR:

```rust
fn foo(_1: (), _2: &'?4 ()) -> Opaque(DefId(foo::{opaque#0}), []) {
    bb0: { switchInt(move _4) -> [0: bb2, otherwise: bb1]; }

    bb1: {
        _0 = &'?2 _1; // bb1[0]
        goto -> bb3;
    }

    bb2: {
        _0 = &'?3 (*_2); // bb2[3]
        goto -> bb3;
    }

    bb3: {
        return;
    }
}
```

And the following region constraints:

<img width="236" height="583" alt="image" src="https://github.com/user-attachments/assets/4c450ccd-1c5c-4a9c-a4f1-0875cf0e5553" />

Note `'?5` and `'?6`: these don't show up in the MIR graph because they arise from the `enable_subtyping` closure in [`relate_opaques`](https://github.com/rust-lang/rust/blob/c9b7f178899788fac53d942b82cf97665ee59aaa/compiler/rustc_borrowck/src/type_check/relate_tys.rs#L116). Importantly (today), these regions are related to each other (and to other regions in hidden types) *at a single point*, but **are not live at any point**.

For NLL this is not a problem (since liveness does not matter for outlives constraint propagation. For Polonius, this is an issue.

The fix here is fairly simple: consider these lifetimes live at all points. This may be an *overestimate* of liveness, but this is all code that doesn't get called with the next solver.

This is also the same reason that this is not an issue with the next solver. Opaque types are normalized in HIR typeck, so these hacky regions are never created.

There are a couple alternative fixes that I think are ultimately not as good:

1) Equate the previous hidden type with the new hidden type using `Locations::All` - when [registering the goals](https://github.com/rust-lang/rust/blob/c9b7f178899788fac53d942b82cf97665ee59aaa/compiler/rustc_borrowck/src/type_check/relate_tys.rs#L161) from equating these two, force `Locations::All` instead of `Locations::Single`.
2) [**Equate all uses, not just the final defining use, in borrowck**](rust-lang/rust@59a4c62) - this has us store any duplicates in `insert_hidden_type`, which then get equated with the "expected" hidden type in `apply_definition_site_hidden_types` with `Locations::All`. I think this is fine, but a lot less "local" logic.

I'll note that for the next solver, we equate the hidden types with the return type in the signature with`Locations::Single`:

<img width="289" height="586" alt="image" src="https://github.com/user-attachments/assets/34d15820-06e3-4205-9278-e82465dca139" />

(note, this MIR is slightly different: `'5` is `short`'s lifetime; `'6` is the lifetime from the normalized opaque (`&'?6 ()`); `'4` is the renumbered lifetime for the MIR body)

Given that, perhaps (1) is the most faithful to the spirit of the next solver (that there is one hidden type that things get related to), but this seems like a *slightly* smaller-in-scope fix.

In any case, I think any solution here is mostly just a waiting game for the next solver.
Always statically link std into rustc_driver

This always statically links std into rustc_driver by removing the MinGW exception.

try-job: dist-x86_64-mingw
…nn,kobzol

Enable `-Znext-solver` on nightly by default



Implementation of rust-lang/compiler-team#1014 cc rust-lang/blog.rust-lang.org#1896 rust-lang/rust#160895

This enables `-Znext-solver=globally` by default in nightly, but keeps `-Znext-solver=coherence` for most tests.
add a cache to the `WfPredicates` visitor





Part of speeding up compiling `ReShell` with `-Znext-solver`, see rust-lang/trait-system-refactor-initiative#272 and [#t-types/trait-system-refactor > more &#96;reshell&#96; slowness](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/more.20.60reshell.60.20slowness/with/616484452).

The PR changes the `WfPredicates` visitor to only collect new bounds for unique types. That is, if we have a type like:

```
type T0 = Map<Then<Whitespace, Whitespace>>
type T1 = Map<Then<T0, T0>>
type T2 = Map<Then<T1, T1>>
...
type T_N = Map<Then<T_N-1, T_N-1>>
```

etc., the visitor used to end up collecting one WF obligation for each path from `T_N` to its `Whitespace` leaves, even though WF of a type (I believe) doesn't depend on the path the visitor took to get there, which allows us to deduplicate by Ty. Not deduplicating caused us to go O(2^N) here.

next-solver is still about ~5x slower than the old solver on the third reproducer due to some other hidden quadratics, and fixing that seems to be more involved, but I think this PR will still be ✨ An Improvement.

r? lcnr
…rtdev

stdarch subtree update

Subtree update of `stdarch` to 0d4e35e.

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

r? @ghost
…able-minification, r=lolbinarycat

compiletest: forward disable-minification from bootstrap

`build.docs-minification = false` was already honored when building docs through bootstrap's doc steps, but compiletest-driven rustdoc suites always generated minified CSS/JS.

Bootstrap now forwards `--disable-minification` to compiletest when docs minification is disabled, and compiletest passes `-Zunstable-options --disable-minification` to rustdoc for HTML/JS/JSON/UI doc generation.

Fixes rust-lang/rust#142737.
…mu001999

Extend `dropping_{references,copy_types}` lints to `drop_in_place`

This PR extends the `dropping_{references,copy_types}` lints to also check for calls to `std::ptr::drop_in_place` and `<*mut _>::drop_in_place`.

It also extends the `undropped_manually_drops` lint.

Fixes rust-lang/rust#160127
cc @theemathas
Add floating point inline ASM support for SPARC

This PR adds support for floating point registers to SPARC inline ASM.

Ping target maintainers: @psumbera @kulikjak @jonathanpallant @mvolfik @he32 @0323pin @semarie

Tracking issues:
f16 inline ASM: rust-lang/rust#125398 (part of rust-lang/rust#116909)
SPARC inline ASM: rust-lang/rust#93335
…Simulacrum

feat: add symmetric PartialEq impls for Vec, &[T], &mut [T] versus Cow<'_, [T]>

add the missing reverse `PartialEq<Cow<'_, [U]>>` impls for `Vec<T, A>`, `&[T]`, and `&mut [T]`, essentially mirroring the existing forwards in `library/alloc/src/vec/partial_eq.rs`

partially addresses rust-lang/rust#152830. The `VecDeque` half of that issue is being handled separately by rust-lang/rust#152972, so there is no overlap with this PR

also fyi: verified locally with `./x test library/alloctests --stage 1` and the new `test_partial_eq_cow_symmetric` test passes alongside the existing alloc test suite
…anBrouwer

Derive `GenericTypeVisitable` for `RegionConstraint` _correctly_

The derive added in rust-lang/rust#160164 was incorrect -- it resulted in an overflow during trait solving. This is because `#[derive(GenericTypeVisitable)]` automatically adds a `: GenericTypeVisitable` bound to every field of a type -- in this case, `Box<[RegionConstraint<I>]>: GenericTypeVisitable<V>`.

To fix this, I added a `#[generic_type_visitable(bounds(..))]` attribute to the derive macro, which allows overriding the added bounds.

I also made the derive macro no longer a no-op in rustc, so that errors like this can be caught on r-l/r CI in the future.

Best reviewed commit-by-commit.

cc @ChayimFriedman2
…white

be more permissive wrt overflow and and improve diagnostics

This builds on rust-lang/rust#160632

Previously we only showed a single root goal for the FCW. It was difficult to find out how the goal overflowed.
We display a proving chain now which should help users identify relevant types or auto traits.

This will affect perf for crates emitting the FCW. E.g. `calimero-store` goes from 4.7s -> 5.7s in local testing since it emits thousands of FCWs internally. The FCW is a mitigation of future hard error and authors are expected to resolve it so it's probably acceptable. It doesn't affect crates without the FCW.

r? lcnr
Add regression test for gce dependency ICE in non-gce crate

Closes rust-lang/rust#128525
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#161558 (stdarch subtree update)
 - rust-lang/rust#159887 (compiletest: forward disable-minification from bootstrap)
 - rust-lang/rust#160229 (Extend `dropping_{references,copy_types}` lints to `drop_in_place`)
 - rust-lang/rust#160949 (Add floating point inline ASM support for SPARC)
 - rust-lang/rust#156160 (feat: add symmetric PartialEq impls for Vec, &[T], &mut [T] versus Cow<'_, [T]>)
 - rust-lang/rust#160914 (Derive `GenericTypeVisitable` for `RegionConstraint` _correctly_)
 - rust-lang/rust#161341 (be more permissive wrt overflow and and improve diagnostics)
 - rust-lang/rust#161530 (Add regression test for gce dependency ICE in non-gce crate)
Update LLVM submodule to latest `release/23.x` branch



This pulls in rust-lang/llvm-project#199 which updates the revision of LLVM 23 to the latest copy of the release branch, just past the rc3 release.
target_features: sse (or at least avx2) is incompatible with soft-float ABI



Fixes rust-lang/rust#117938

Enabling both the avx2 and soft-float target features is [not supported by LLVM](rust-lang/rust#117938 (comment)) and can crash the backend. Let's preempt that with rust-level checks. (I still think there's also an LLVM bug here, it shouldn't just SIGILL on unexpected target feature configurations, but that's a different discussion.)


What is not clear to me is whether this just affects just avx2 or also avx or even sse (we don't support mmx/3dnow separately).  @dianqk do you know more about this? To be safe, let's reject "sse" and therefore by implication also all other x86 vector target features.

This PR turns `#[target_feature(enable = "sse")]` on a softfloat target into an FCW similar to what we do on aarch64 (see rust-lang/rust#135160). The FCW only affects people building for soft-float targets which is a fairly small percentage of our overall users (and which means we cannot meaningfully crater this). I hence went for "report in deps" immediately so that the people building the actual binaries see these warnings that their upstreams probably will never see.
bors and others added 3 commits August 23, 2026 23:29
Clippy subtree update



r? Manishearth 

Cargo.lock update due to Clippy version bump
This updates the rust-version file to da5114692c9ebe46b869488c5f34f92eb10b98c1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants