Commit Graph

339775 Commits

Author SHA1 Message Date
Adam Gemmell
7cbced258c Update vzipq arm instruction assertions 2026-09-08 14:38:52 +01:00
Adam Gemmell
0016f59536 Run rustfmt 2026-09-07 19:00:53 +01:00
The rustc-josh-sync Cronjob Bot
a3ff62c7ea Merge ref '32d94cc9be3f' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@32d94cc9be
Filtered ref: rust-lang/stdarch@cd16820ce5
Upstream diff: da5114692c...32d94cc9be

This merge was created using https://github.com/rust-lang/josh-sync.
2026-09-07 04:19:32 +00:00
Guillaume Gomez
6c6586a77d Correctly handle dyn trait methods linking for jump to def feature 2026-09-19 22:15:15 +02:00
bors
ca0a6473ff Auto merge of #162625 - JonathanBrouwer:rollup-n0V8kc1, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#162223 (`-Znext-solver` : Abort on the first overflowed obligation in fulfillment)
 - rust-lang/rust#161654 (Eagerly report overflow errors in normalization query)
 - rust-lang/rust#162176 (Clean up some small things related to lint `ambiguous_glob_imported_traits`)
2026-09-11 07:13:44 +00:00
Jonathan Brouwer
65182f17ad Rollup merge of #162176 - fmease:clean-up-ambig-glob-imp-traits, r=adwinwhite
Clean up some small things related to lint `ambiguous_glob_imported_traits`

Cleaning up things I noticed in the vicinity while reviewing PR https://github.com/rust-lang/rust/pull/157968 (which concerns lint `ambiguous_glob_imported_traits` and feature `supertrait_item_shadowing`).

Namely,

1. turning two tuple struct variants into named ones to avoid "anonymous `bool`s"
2. fixing an inaccurate `supertrait_item_shadowing`-specific doc comment
3. applying the rules listed in our [Diagnostic output style guide](https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-output-style-guide) to the diagnostic of lint `ambiguous_glob_imported_traits`

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
2026-09-11 09:00:40 +02:00
Jonathan Brouwer
137500c964 Rollup merge of #161654 - adwinwhite:post-analysis-ice, r=lcnr
Eagerly report overflow errors in normalization query

Fixes https://github.com/rust-lang/rust/issues/161542

We still have rigid opaques in `TypingMode::PostAnalysis` after `PostAnalysisNormalize` pass because we ignore normalization errors in the [`PostAnalysisNormalize` pass](04a3cad16c/compiler/rustc_mir_transform/src/post_analysis_normalize.rs (L66)). We can't handle errors there as we don't have enough information to detect whether they're overflows.

This doesn't cause problems for the old solver because it eagerly emits overflow error in evaluation.
We try to do the same in the next solver.

I don't really know who to assign. Maybe r? @jdonszelmann
cc @lcnr
2026-09-11 09:00:39 +02:00
Jonathan Brouwer
6b55536bd3 Rollup merge of #162223 - adwinwhite:abort-on-fulfillment-overflow, r=lcnr
`-Znext-solver` : Abort on the first overflowed obligation in fulfillment

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/294 cc https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/handling.20overflow.20in.20fulfill/with/621040305

We used to drop all subsequent obligations when one obligation overflows in fulfillment. It means that we don't really prove all obligations even if fulfillment has no pending obligations and returns no error. We now eagerly abort on the first overflowed obligation.

r? @ShoyuVanilla
cc @lcnr
2026-09-11 09:00:38 +02:00
bors
a59b87ab99 Auto merge of #162622 - jhpratt:rollup-F7fv0Yu, r=jhpratt
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#162270 (Update `windows-bindgen` to 0.100.0)
 - rust-lang/rust#162492 (Revert "Rollup merge of rust-lang/rust#157518 - CAD97:xdg_basedir, r=aapoalas")
 - rust-lang/rust#162607 (Basic cleanup in `rustc_transmute`)
 - rust-lang/rust#162619 (Add test for the missing Clone requirement for Cow slices)
 - rust-lang/rust#162172 (mention the opaque when its hidden type cannot be inferred)
 - rust-lang/rust#162514 (Simplify diagnostic levels)
 - rust-lang/rust#162546 (Use lld by default on `loongarch64-unknown-linux-gnu` nightly)
 - rust-lang/rust#162564 (yeet StabilityLevel)
 - rust-lang/rust#162613 (iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items)
 - rust-lang/rust#162616 (regression test for async main diagnostic)
2026-09-11 04:04:07 +00:00
Jacob Pratt
2eaa6012ac Rollup merge of #162616 - malezjaa:add-async-main-regression-test, r=chenyukang
regression test for async main diagnostic

Closes rust-lang/rust#78905
2026-09-11 00:03:14 -04:00
Jacob Pratt
ae7ebc8d39 Rollup merge of #162613 - voodookiidoo:add-iter-diagnostic-items, r=mejrs
iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items

added iter::repeat_with, iter::successors, iter::from_fn as diagnostic items, in order for clippy to be able to register them and work with them. Link to clippy issue: https://github.com/rust-lang/rust-clippy/issues/17719
2026-09-11 00:03:13 -04:00
Jacob Pratt
e8a9e14d02 Rollup merge of #162564 - mejrs:yeet, r=chenyukang
yeet StabilityLevel

It is unused.
2026-09-11 00:03:12 -04:00
Jacob Pratt
b1baa4f7b9 Rollup merge of #162546 - heiher:loong64-gnu-lld-nightly, r=chenyukang
Use lld by default on `loongarch64-unknown-linux-gnu` nightly

This PR makes LLD the default linker for `loongarch64-unknown-linux-gnu` on nightly.

As a prerequisite, it aligns the LoongArch64 Linux `LOAD` segment layout of LLD and other GNU-compatible linkers with GNU ld. This keeps the layout consistent and allows Linux to make better use of file-backed PMD mappings.

The LLD default is initially limited to nightly to allow some soak time before rolling it out to beta and stable.

To opt out of using LLD, `RUSTFLAGS="-Clinker-features=-lld"` would be used. To opt out of using rust-lld, falling back to the LLD installed on the system, `RUSTFLAGS="-Clink-self-contained=-linker"` would be used.
2026-09-11 00:03:11 -04:00
Jacob Pratt
d971af8b59 Rollup merge of #162514 - nnethercote:simplify-diag-Levels, r=oli-obk
Simplify diagnostic levels

This PR separates diagnostic levels from subdiagnostic levels and does a few preliminary cleanups. Details in individual commits.

r? @oli-obk
2026-09-11 00:03:10 -04:00
Jacob Pratt
8abb416b29 Rollup merge of #162172 - Albab-Hasan:opaque-hidden-type-inference-note, r=chenyukang
mention the opaque when its hidden type cannot be inferred

when the hidden type of an opaque was never constrained, typeck reported `E0282` with only the shared cannot infer type label. nothing in the output said an opaque was involved, so the error read like an ordinary local inference failure.

the unconstrained hidden type arm now adds a note naming the opaque as the source of the ambiguity.

fixes https://github.com/rust-lang/rust/issues/146231

r? @lcnr
2026-09-11 00:03:09 -04:00
Jacob Pratt
0180298a84 Rollup merge of #162619 - chenyukang:yukang-fix-141241-cow-clone-diagnostic-test, r=jieyouxu
Add test for the missing Clone requirement for Cow slices

Fixes rust-lang/rust#141241
2026-09-11 00:03:08 -04:00
Jacob Pratt
8021397858 Rollup merge of #162607 - joshlf:transmute-cleanup, r=jswrenn
Basic cleanup in `rustc_transmute`

The content of this PR was authored by an LLM.

r? @jswrenn
2026-09-11 00:03:07 -04:00
Jacob Pratt
6036ee7658 Rollup merge of #162492 - CAD97:rm-xdg, r=ChrisDenton
Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas"

This reverts commit ac8006482d, reversing changes made to 8d6b38095e.

<!-- homu-ignore:start -->

- https://github.com/rust-lang/rust/issues/157515 is superseded
- This includes just the revert that's the first commit in https://github.com/rust-lang/rust/pull/158936
2026-09-11 00:03:06 -04:00
Jacob Pratt
4e1c7f9f55 Rollup merge of #162270 - ChrisDenton:winagain, r=clarfonthey
Update `windows-bindgen` to 0.100.0

This release represents a major change in the way bindings are generated. See https://github.com/microsoft/windows-rs/issues/4867 for details.

In short, it now more directly follows the C headers. For the standard library's purposes this is mostly reflected in relatively minor type changes or with some `const` pointers becoming `mut`.

There is however one big change that affects a lot of types. In the headers there are a lot of `#define`s like this:

```c
#define GENERIC_READ                     (0x80000000L)
#define GENERIC_WRITE                    (0x40000000L)
```

These are constants for the access mode. In this case they're explicitly declared as `L` (aka signed long) integer types (in other cases there's no type at all). However, this conflicts with how access mode constants are actually used. E.g., see `CreateFileW`:

```c
WINBASEAPI
HANDLE
WINAPI
CreateFileW(
    _In_ LPCWSTR lpFileName,
    _In_ DWORD dwDesiredAccess,
    _In_ DWORD dwShareMode,
    _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
    _In_ DWORD dwCreationDisposition,
    _In_ DWORD dwFlagsAndAttributes,
    _In_opt_ HANDLE hTemplateFile
    );
```

Here `dwDesiredAccess` is a `DWORD`, which in rust equates to `u32`. The constant being signed but the usage being unsigned is not a problem for C/C++. They will happily convert between types at the drop of a hat. Rust however is stricter, as you know.

The old metadata used by `windows-bindgen` tried to try to fixup this mismatch but the new one goes strictly by what can be inferred from the headers.  The hope in the future is that the headers themselves will be updated so better bindings can be directly derived from them.
2026-09-11 00:03:06 -04:00
Adwin White
96536dddaa eagerly report overflow errors 2026-09-11 10:01:10 +08:00
malezjaa
01fd255335 regression test for async main diagnostic 2026-09-11 00:19:01 +02:00
Артём
98d3e1bd32 Update library/core/src/iter/sources/repeat_with.rs
item_name fix

Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>
2026-09-11 02:39:00 +05:00
Chris Denton
d45c710149 Remove unnecessary manual bindings
Mingw used to have an incorrect import library for the synchronization functions `WaitOnAddress`, `WakeByAddressSingle` and `WakeByAddressAll`. This was fixed a long time ago and our windows-gnu targets require a much newer mingw in any case.
2026-09-10 21:24:00 +00:00
Chris Denton
fc4de336c5 Use new windows bindings 2026-09-10 21:23:52 +00:00
bors
9e9544da4c Auto merge of #162612 - JonathanBrouwer:rollup-Ma0hPul, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#161334 (Fix soundness issues in std::sys::pal::sgx::waitqueue::unsafe_list)
 - rust-lang/rust#162346 (rustdoc: add missing CCI union logic)
 - rust-lang/rust#162273 (doc: replace `exceeding_bitshifts` with `arithmetic_overflow`)
 - rust-lang/rust#162539 (Update wasip2/wasip3 libstd crate dependencies)
 - rust-lang/rust#162542 (Gate ELF code in metadata.rs for ELF only)
 - rust-lang/rust#162604 (Update windows-gnu support docs)
2026-09-10 21:17:34 +00:00
voodookiidoo
23b52a6a18 iter::from_fn added as diagnostic items (requiered for clippy analysis) 2026-09-11 02:00:34 +05:00
Nicholas Nethercote
6331ab69b4 Introduce Sublevel for errors
Currently `Level` is used for both diagnostics and subdiagnostics. But
both diagnostics and subdiagnostics only use some of the levels. This
commit introduces `Sublevel` to tighten up the representation and
prevent impossible combinations.
2026-09-11 06:46:46 +10:00
Nicholas Nethercote
a956ff03c6 Tweak a use item
Use the `FatalError` re-export from `rustc_errors` instead of
`rustc_span`, because that's what's normally done.
2026-09-11 06:44:47 +10:00
Nicholas Nethercote
996ef5d739 Replace a format_diag_messages use
When there's a single message, `format_diag_message` suffices.
2026-09-11 06:41:29 +10:00
Nicholas Nethercote
025e029824 Reduce unnecessary Cow use in error formatting
`format_diag_messages` always constructs a `String`, so it can just
return that. This simplifies various call sites.
2026-09-11 06:41:29 +10:00
Nicholas Nethercote
63fddb3657 Remove Style::HeaderMsg
It has a single use, where it is passed in to `format_diag_messages`
which then discards it. So that use can be replaced with
`Style::NoStyle`.
2026-09-11 06:41:29 +10:00
Nicholas Nethercote
7bc87d508d Remove most Style variants
These are dead since the old emitter was removed in Jan 2026
(3ccabc6a8d).

Also removed: `BRIGHT_BLUE`, `Level::color`, and a couple of `level`
fn parameters.
2026-09-11 06:41:29 +10:00
voodookiidoo
b760816070 iter::repeate_with and iter::successors added as diagnostic items (requiered for clippy analysis) 2026-09-11 01:37:53 +05:00
Jonathan Brouwer
013f1e3eaf Rollup merge of #162604 - mati865:update-windows-gnu-docs, r=hanna-kruppe
Update windows-gnu support docs

Followup to rust-lang/rust#161681.
2026-09-10 22:34:01 +02:00
Jonathan Brouwer
3532a4cefb Rollup merge of #162542 - xingxue-ibm:gate-elf-code-for-elf, r=khyperia
Gate ELF code in metadata.rs for ELF only

This PR gates ELF specific code for `BinaryFormat::Elf`. With this change, fallback for PowerPC64 on AIX is no longer needed.

---------

Assisted-by: IBM Bob
The issue was discovered by IBM Bob while checking changes for other things, and I personally verified the bug. Although the fix is trivial, I ran it through IBM Bob to make sure I wasn’t missing anything.
2026-09-10 22:34:00 +02:00
Jonathan Brouwer
02056c6f40 Rollup merge of #162539 - alexcrichton:update-wit-bindgen-deps, r=ChrisDenton
Update wasip2/wasip3 libstd crate dependencies

Picks up the latest version of the `wit-bindgen` dependency which has improved compatibility for `wasm32-wasip3`.
2026-09-10 22:33:59 +02:00
Jonathan Brouwer
9de53713ae Rollup merge of #162273 - chiang03:main, r=Enselic
doc: replace `exceeding_bitshifts` with `arithmetic_overflow`

lint `exceeding_bitshifts` has been merged into `arithmetic_overflow` in PR rust-lang/rust#69185
2026-09-10 22:33:58 +02:00
Jonathan Brouwer
19f7664b1c Rollup merge of #162346 - notriddle:rustdoc-merge-type, r=lolbinarycat,GuillaumeGomez
rustdoc: add missing CCI union logic

This fixes a bug that was found where `PathBuf` didn't show up in the standard library search results, because the crate that defined it (libstd) was merged into a crate that already had a path entry in its search index (libproc_macro).

Fixes https://github.com/rust-lang/rust/issues/162334
2026-09-10 22:33:57 +02:00
Jonathan Brouwer
83e0995a64 Rollup merge of #161334 - jethrogb:fix-sgx-unsafe-list, r=nia-e
Fix soundness issues in std::sys::pal::sgx::waitqueue::unsafe_list

Replace invalid uses of references in `std::sys::pal::sgx::waitqueue::unsafe_list` internals with raw pointers. I tried to keep the code structure the same as much as possible. In addition to the use of references flagged in the original issue, it turns out the head/tail (raw) pointer stored in the linked list caused provenance issues in miri. Switched to using UnsafePinned for that.

PR organization:
* Commit 1: Main soundness fix.
* Commit 2: Use pinning in the `pub(crate)` API for UnsafeList. This code predates pinning in Rust. I believe this change isn't strictly necessary as I believe it's valid to document pinning requirements in the unsafe methods on UnsafeList. However, I felt it's better to be explicit about this now that pinning is available in the language.
* Commit 3: Move UnsafeList to a platform-agnostic location so miri can be run on the test suite. This also adds some tests.

This PR was developed with Claude Fable 5 through extensive interactive use, where I directed a detailed plan for making the changes needed for this fix. My input includes keeping the structure the same and the new internal abstraction for dealing with raw pointers. I'm not familiar with miri, I used Claude to test the changes with miri. It said the test suite was failing before the changes (both stacked borrows and tree borrows) but passing after. The additional tests developed this way have been added in the third commit. The head/tail pointer provenance issue was found with Claude. I thoroughly reviewed all the code, including comments, and made manual changes/deletions where necessary/appropriate. The PR description was written by me.

r? @nia-e

Fixes rust-lang/rust#114581
Fixes rust-lang/rust#160603
Fixes rust-lang/rust#161060
Supersedes rust-lang/rust#160641
2026-09-10 22:33:56 +02:00
Mateusz Mikuła
6d92da7642 Update windows-gnu support docs 2026-09-10 20:46:58 +02:00
bors
67eda617e6 Auto merge of #162531 - khyperia:abby-perf, r=BoxyUwU
fix perf regression from abby canonical form



https://github.com/rust-lang/rust/pull/161306 regressed performance on stable

I believe all the perf impact is due to this

d8df82673d/compiler/rustc_infer/src/infer/mod.rs (L186)

before, `SolverRegionConstraintStorage` was a dummy simple thing, no allocations.

now, it's a `RegionConstraint { and: Box([]), or: Box([Box([])]) }`

the majority of the perf impact (70%ish I think) is because the compiler is not sufficiently smart to optimize `And::new([])` into `And(Box::new([]))` (the former does a bunch of `IndexSet` allocations and stuff, the latter is a no-op, just a nullptr plus zero length metadata)

the the rest of the perf impact (30%ish) is due to the `or` case allocating the `Box([Box([])])`, it's not just a nullptr+zero

options to fix:

- option A: just fix the `And::new([])` being terrible
- option B: option A, *and also*, `SolverRegionConstraintStorage` stores an `Option` that is lazily init on first access, to prevent the perf hit from the `or` case
- option C: option A, *and also*, use some kind of `SmallVec` something or other to make the `or` case be zero-alloc. I have not profiled this due to it being an invasive change and effort, this might not actually fix the perf.

This PR is out option A to see if it actually works with the full perf machinery with PGO and whatnot instead of just on my machine (I am very inexperienced with perf testing!). It might be the case that full PGO blah blah *is* actually sufficiently smart to optimize `And::new([])`, and the actual perf diff is due to the `or` case (which I'm calling the 30%ish impact, might be actually 100%), in which case this PR should produce a no-op perf diff.

r? @BoxyUwU
2026-09-10 18:07:46 +00:00
Josh Liebow-Feeser
ac29954852 Exercise nonzero-sized uninhabited destinations
Use each YawningVoid type as a destination in its UI test instead of
repeating the zero-sized Void case. Equal-sized u128 sources prevent a
size mismatch from masking a failure to reject an uninhabited destination.
Update the copied explanations and regenerate the diagnostic snapshot.

Validation: ./x test tests/ui/transmutability

Agent-Authored-By: AI agent acting on Josh Liebow-Feeser's behalf
2026-09-10 15:41:11 +00:00
Josh Liebow-Feeser
eb7625d361 Document DFA interval union and improve debug output
Specify interval-union inputs and output partitions and test overlaps,
boundaries, and coalescing. Mark DOT entry and accepting states distinctly,
log full graphs once per query, and omit the memoization cache from spans.

Validation: ./x test compiler/rustc_transmute
A manual bool identity query with RUSTC_LOG=rustc_transmute=debug confirmed
one source graph, one destination graph, and no cache dumps.

Agent-Authored-By: AI agent acting on Josh Liebow-Feeser's behalf
2026-09-10 15:41:01 +00:00
Josh Liebow-Feeser
c4d1307f90 Clarify transmutability queries and cover answer composition
Describe the query stages and deferred obligations, correct stale comments,
and exercise both validity settings in the powerset test. Add direct checks
for condition grouping, error selection, and quantifier short-circuiting.

Document the existing conditional behavior of Answer::or without changing it.

Validation: ./x test compiler/rustc_transmute

Agent-Authored-By: AI agent acting on Josh Liebow-Feeser's behalf
2026-09-10 15:40:51 +00:00
Josh Liebow-Feeser
4b5434b710 Document transmute layout trees and test alternative pruning
Explain the byte alphabet, padding, definition markers, and empty layouts.
Cover surviving and fully pruned alternatives, including nested sequences,
and replace obsolete visibility terminology.

Validation: ./x test compiler/rustc_transmute

Agent-Authored-By: AI agent acting on Josh Liebow-Feeser's behalf
2026-09-10 15:40:39 +00:00
bors
018018e881 Auto merge of #162592 - JonathanBrouwer:rollup-3q5U3Oo, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#162581 (Subtree sync for rustc_codegen_cranelift)
 - rust-lang/rust#160831 (re-equate the object bound's trait ref with the goal's when considering object bounds)
 - rust-lang/rust#162057 (Some cleanups around fatal errors and delayed bugs)
 - rust-lang/rust#162437 (fix(traits): Remove expression references from index suggestions)
 - rust-lang/rust#162534 (Fix run-make/prune-link-args to work with MinGW)
 - rust-lang/rust#162554 (Attemped fix for home dir problem on `dist-aarch64-llvm-mingw`)
 - rust-lang/rust#162576 (doc: Fix external mention of signum() return value regarding NaNs)
2026-09-10 12:23:33 +00:00
Jonathan Brouwer
fbfe562415 Rollup merge of #162576 - xkr47:fix/doc-signum-nan-return, r=Darksonn
doc: Fix external mention of signum() return value regarding NaNs

`is_sign_positive()`/`is_sign_negative()` documentation refer to using `signum() ` but misrepresent the return value of the latter; `signum()` returns a float so it cannot be `false`; `signum()` documentation documents it as returning a NaN in this case, so propagated that to these references.
2026-09-10 14:22:34 +02:00
Jonathan Brouwer
391c5c8640 Rollup merge of #162554 - JonathanBrouwer:attempted-fix, r=jieyouxu,Kobzol
Attemped fix for home dir problem on `dist-aarch64-llvm-mingw`

This is a fix for this spurious failure, which seems to regularly happen lately
https://github.com/rust-lang/rust/pull/162550#issuecomment-5608460056

disclaimer: I have no clue what is causing this and that I'm just attacking the symptoms. Seems like some kind of github runner misconfiguration?

The PR is being discussed here: [#t-infra > Tree ops @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Tree.20ops/near/622969695)
2026-09-10 14:22:33 +02:00
Jonathan Brouwer
e5d80d1a5e Rollup merge of #162534 - mati865:prun-link-args-test-mingw, r=oli-obk
Fix run-make/prune-link-args to work with MinGW

The explanation provided was wrong. Libc doesn't exist on Windows, so naturally this failed on missing lib. I have no idea what shenanigans link.exe does to make this pass, but surely it doesn't actually link libc.
2026-09-10 14:22:32 +02:00
Jonathan Brouwer
f9e8678047 Rollup merge of #162437 - NuclEnergy:fix/suggest_dereferencing_index, r=jieyouxu
fix(traits): Remove expression references from index suggestions

Fix issue: rust-lang/rust#162419
2026-09-10 14:22:31 +02:00