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`)
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>
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
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
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.
Simplify diagnostic levels
This PR separates diagnostic levels from subdiagnostic levels and does a few preliminary cleanups. Details in individual commits.
r? @oli-obk
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
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.
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.
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.
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.
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.
Update wasip2/wasip3 libstd crate dependencies
Picks up the latest version of the `wit-bindgen` dependency which has improved compatibility for `wasm32-wasip3`.
doc: replace `exceeding_bitshifts` with `arithmetic_overflow`
lint `exceeding_bitshifts` has been merged into `arithmetic_overflow` in PR rust-lang/rust#69185
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