Update cargo submodule
9 commits in 7941be6fb416b4cd9666aef7b858dfea25587a8c..495c385d0875c4ba51eb72ea0448a2d4c018b8d4
2026-09-11 20:47:37 +0000 to 2026-09-16 12:48:58 +0000
- Report the number of errors with `build.warnings='deny'` (rust-lang/cargo#17479)
- fix: return correct package specs when resolving workspace deps (rust-lang/cargo#17469)
- refactor(config): Consolidate more config table definitions (rust-lang/cargo#17480)
- fix(git): For git cli, tell users what config we aren't forwarding on error (rust-lang/cargo#17477)
- Lower the lint level of `manual_readme` and `non_kebab_case_bins` to `allow` (rust-lang/cargo#17478)
- fix(trim-paths)!: unremap file in one JSON doc (rust-lang/cargo#17476)
- feat(manifest): support `feature-documentation` in manifests (rust-lang/cargo#17447)
- chore: Add Muscraft to the review rotation (rust-lang/cargo#17471)
- Specify `--edition` in `messages` tests (rust-lang/cargo#17470)
r? Urgau
for the debugger script part
---
🤖 LLM disclosure: I probably should have tested this change manually, though I let LLM verify it working, sorry. Will do a manual test when I have time or if somebody beats me on that.
Offload cmake cleanups
r? kobzol
Split out of https://github.com/rust-lang/rust/pull/161565, which requires (minor) LLVM changes.
These cleanups are valuable on their own already, and shouldn't be blocked. So let's land it, before it get's stale with all the refactoring going on ^^
Copied the disclaimer: I used an llm to implement the fixes, since I still don't like cmake.
I confirm that on a high-level these are the right fixes as far as I can tell, and I reviewed/refactored it.
[rustc_public] Enhance PassMode API
This change is split into two different commits:
1. [Expand PassMode::Cast with CastTarget](5823ef2aae): This is basically a 1:1 mapping from the internal compiler representation.
2. [Replace Opaque with ArgAttributes in PassMode](75405294d0): Expose the non-LLVM specific ArgAttributes information. Leave the internal representation private for now in case we do want to expand its implementation later.
wasm: fix ABI for enums with integer layout and ZST fields
fixes https://github.com/rust-lang/rust/issues/121408
follow-up to https://github.com/rust-lang/rust/pull/162806
Clang is doing something that is rather annoying for us to emulate: like with unions it looks at the structure of the type, not the representation. But in rust an `enum` that is represented as an integer is not considered an `aggregate` at all, yet may still need to be passed as one if it has any (even ZST) fields.
r? alexcrichton
cc @hanna-kruppe
Cleanups related to RefDecodable
- Earlier experiments: https://github.com/rust-lang/rust/pull/162287
---
This PR is a series of cleanups to the RefDecodable trait and its associated impls.
Details in individual commits.
There should be no change to compiler output.
r? nnethercote (or compiler)
Enable LLVM Thin LTO for LoongArch64
This PR switches the LLVM build cross-compiler from GCC to Clang and enables LLVM Thin LTO for LoongArch64 distributions.
There is no significant performance difference with this change. It also reduces the size of the build artifacts:
| Artifacts | Before | After |
|-------------------------------------------------------|--------|-------|
| rust-nightly-loongarch64-unknown-linux-gnu.tar.xz | 287M | 177M |
| rust-nightly-loongarch64-unknown-linux-gnu directory | 1.6G | 849M |
| rust-nightly-loongarch64-unknown-linux-musl.tar.xz | 285M | 177M |
| rust-nightly-loongarch64-unknown-linux-musl directory | 1.6G | 847M |
---
try-job: dist-loongarch64*
rustc: Tweak the effect of `--jobs` on frontend parallelism
We need to be able to express both of these things for the frontend parallelism:
- "Use exactly `N` threads", `--jobs-frontend=N` does this.
- "Use some default number of threads, but not larger than `N`", `--jobs=N` will do it after this PR.
The "default number" may be 1 now, or 2 during the upcoming nightly testing, or 4 or 8 after the stabilization if we decide to cap the parallelism.
Part of https://github.com/rust-lang/compiler-team/issues/1005.
r? @bjorn3
implement const Iterator for Range
This allows the use of `for i in i..n` in `const`.
This I believe is interesting enough to be justified under https://github.com/rust-lang/rust/issues/155816
r? @oli-obk
Improve `Session`/`CodegenBackend` construction
The creation and initialization of sessions and codegen backends is intertwined, which is confusing and error prone. This PR detangles things, and also simplifies the types used for the state within the backends. Details in individual commits.
r? @bjorn3
It's now possible to get the backend features (a `Vec<String>`) when the
codegen backend is started, pass it back through `CodegenBackendInit`,
and just store it in the `Session`. This removes the need for the query.
Also:
- `WriteBackendMethods::target_machine_factory` no longer needs the
`target_features` parameter, because it's now available through the
`sess` parameter.
- `CodegenContext` no longer needs the `backend_features` field because
we can use `sess.global_backend_features` instead.
- `CodegenBackend::provide` is now a no-op for all the in-tree backends.
I haven't removed it because out-of-tree backends still rely on it.
It currently takes `&self`, which is a bit strange for an `init` method.
As a result, the Cranelift and GCC backends have to use types with
interior mutability.
This commit changes it to `&mut self`. Benefits:
- The Cranelift backend can use `Option` instead of `OnceCell` to
indicate uninit vs. init.
- The GCC backend can avoid `Mutex`, and use `bool` instead of
`AtomicBool`, which makes things much simpler. The commit also
restructures `GccCodegenBackend` to mirror `CraneliftCodegenBackend`:
just contain an `Option<BackendConfig>`, which makes the uninit vs.
init distinction foolproof. (E.g. no need to set `lto_supported` to
false and then later overwrite it with the real value.) As part of
this the `LockedTargetInfo` type is renamed `SharedTargetInfo` because
that better matches its new internals. (All this compiles both with
and without the "master" feature set.)
Session creation is currently awkward: we build a mostly-initialized
session, then use it to initialize a codegen backend, and then use the
codegen backend to finish initializing the session.
And it's not just awkward: within the Cranelift backend's `init` method
`sess.lto()` is called, which consults `sess.thin_lto_supported`,
*before* that field has been properly set! In practice it had no effect
but it's worth fixing.
This commit cleans up this mess. It introduces `EarlySession`, which
contains just four `Session` fields, the ones that are needed for
codegen backend initialization. It is now a field within `Session`, and
`Session` derefs to `EarlySession` to avoid changing a zillion
`sess.target`/`sess.opts`/etc. occurrences. `EarlySession` is passed to
`init`, which returns a `CodegenBackendInit` that contains the
backend-specific information needed to build a `Session`. (It replaces
the `replaced_intrinsics`, `fallback_intrinsics`, and
`thin_lto_supported` methods.) The `Session` can then be built in a
single step. No more `Session`/`CodegenBackend` initialization
intermingling.
A few functions that previously took a `Session` now take something
else, e.g. a `Target`. Some `Session` methods are now `EarlySession`
methods. And a new `early_lto` method is used for Cranelift's LTO check.
This PR switches the LLVM build cross-compiler from GCC to Clang and
enables LLVM Thin LTO for LoongArch64 distributions.
There is no significant performance difference with this change. It
also reduces the size of the build artifacts:
| Artifacts | Before | After |
|-------------------------------------------------------|--------|-------|
| rust-nightly-loongarch64-unknown-linux-gnu.tar.xz | 287M | 177M |
| rust-nightly-loongarch64-unknown-linux-gnu directory | 1.6G | 849M |
| rust-nightly-loongarch64-unknown-linux-musl.tar.xz | 285M | 177M |
| rust-nightly-loongarch64-unknown-linux-musl directory | 1.6G | 847M |
Currently a `NodeId` is stored in a pair with each nested use tree. This
commit changes the pair to a named type `UseTreeAndId`. In most places
this doesn't make much difference but in the AST visitor it gets rid of
several weird special cases.
Rollup of 7 pull requests
Successful merges:
- rust-lang/rust#161873 (move bug and span_bug macros to rustc_span)
- rust-lang/rust#162584 (Use File::*lock*() in rustc_data_structures::flock when possible)
- rust-lang/rust#162704 (Parser: Uninterpolate when checking for const closures, try bikeshed blocks & in relevant diagnostic code)
- rust-lang/rust#162787 (Fix suggestions for names captured by formatting macros)
- rust-lang/rust#159562 (Windows: cache the stdio write mode for the duration of a lock session)
- rust-lang/rust#162813 (Pre lint port cleanups)
- rust-lang/rust#162822 (PassWrapper: adapt for removal of EABIVersion arg in LLVM 24)
The existing `codec` module contains a sea of impls that is hard to navigate.
Extracting the RefDecodable parts into another file should make it easier to
keep track of what is where.
This commit tries to move everything as-is, so that `git diff --color-moved`
can verify that nothing was changed. Subsequent commits will modify the moved
code.
For !needs_drop types, this should allow decoding directly into the
arena-allocated slice.
For needs_drop types, the arena already collects into a SmallVec<T>, so this
avoids an intermediate conversion from Vec<T> to SmallVec<T>.
BREAKING CHANGE: `ValueAbi` is renamed to `ValueRepr` and the
`LayoutShape::abi` field is renamed to `LayoutShape::value_repr`.
The old name was misleading: this type does not describe how values
are passed in function calls (that is `PassMode`), it is a hint for
how backends should represent values (as scalars, vectors, or
aggregates). This aligns with the internal rename from `Abi` to
`BackendRepr`.
Also fixes several doc comments that incorrectly claimed layout
fields define calling behavior.
Expose argument ABI attributes through a structured type instead of
opaque debug strings. ArgAttributes provides accessors for the
extension mode (zero/sign-extend) and pointee alignment, which are
needed by tools doing their own code generation.
This removes all uses of Opaque from the abi module.
Replace the opaque representation of `PassMode::Cast` with a
structured `CastTarget` type that exposes the register layout
used by the platform ABI. Add `Uniform`, `Reg`, and `RegKind`
types so tools can inspect how arguments are mapped to registers.
Add `CastTarget::size()` and `Uniform::reg_count()` helpers.
Add a test covering cast on args, returns, mixed register kinds,
multiple arguments, and register exhaustion causing stack spill.
Fix non-deterministic encoding of syntax contexts
Reiteration of rust-lang/rust#157409. Explanation can be found in comment for `encoding_indices` and in the issue.
Fixesrust-lang/rust#129094. Blocked by rust-lang/rust#161353.
r? @petrochenkov
_No llms used._
PassWrapper: adapt for removal of EABIVersion arg in LLVM 24
We never set this to anything but the default that I noticed, and [now](https://github.com/llvm/llvm-project/pull/222672) it's derived from the target triple in LLVM 24.
@rustbot label: +llvm-main
Windows: cache the stdio write mode for the duration of a lock session
On Windows, every write to stdout/stderr calls `GetStdHandle` and `GetConsoleMode` (and `GetConsoleOutputCP` for consoles) to decide how to write. For bulk writes through a locked handle that is most of the work; rust-lang/rust#154071 measured 14% of CPU time in `is_console` alone.
This caches the handle and the console verdict in the sys-level `Stdout`/`Stderr` and re-queries when a new lock session begins, as [suggested in the issue](https://github.com/rust-lang/rust/issues/154071#issuecomment-4092410339). Holding a `StdoutLock` pins the stream; unlocked writes acquire the lock per call, so they re-query per write exactly as before, and `SetStdHandle` calls made between lock sessions keep working (the rust-lang/rust#40490 behavior is preserved).
Numbers from the issue's workload shape (16 KiB chunks to `NUL`, 4 GiB total, Windows 11):
| mode | before | after |
|---|---|---|
| `stdout().lock()` | 0.478 s (8,561 MiB/s) | 0.120 s (34,350 MiB/s) |
| unlocked | 0.467 s | 0.293 s |
The unlocked case also improves because one implicit lock session can contain several sys-level writes when `LineWriter` splits a chunk at newlines.
The console path cannot run in CI, so it was verified under a pseudoconsole: several writes through one lock session on a CP437 console came through `WriteConsoleW` intact (non-ASCII included), and after `SetConsoleOutputCP` plus a new lock session the refresh picked up the change.
The `refresh` hook is a small `#[cfg(windows)]` shim on `StdoutRaw`/`StderrRaw`; happy to change it to a method on every platform's sys type instead if that is preferred.
Fixesrust-lang/rust#154071
Parser: Uninterpolate when checking for const closures, try bikeshed blocks & in relevant diagnostic code
On main, various places in the parser manually check for `TokenKind::Ident(…)` while in *most* cases that's not correct / complete as it doesn't account for *interpolated* identifiers (`TokenKind::NtIdent(…)`, "non-terminal" identifiers, i.e., ones that originate from macro metavariables `$ident`).
I've looked at all occurrences of `TokenKind::Ident` & `token::Ident` in the parser to see if each place was intentionally ignoring `NtIdent` or not. I found out that the code pertaining to const closures (unstable feature `const_closures`), to try bikeshed blocks (unstable feature `try_blocks_heterogeneous`) and to some diagnostics & parse error recoveries did not intend to ignore interpolated identifiers. This PR rectifies that.
Note that in most cases, it's not necessary to manually match against `NtIdent` as you can simply utilize helpers like `Token::uninterpolate`, `Token::ident`, `Token::is_keyword`, `Token::is_non_raw_ident` which handle them internally.
I also took the chance to clean up in each vicinity.
<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
Use File::*lock*() in rustc_data_structures::flock when possible
And only fallback to `fcntl(F_SETLK)` on Unix when `flock()` is not supported. `flock()` is a lot more sane than `fcntl(F_SETLK)` as it is fd scoped rather than process-scoped and reentrant. `fcntl(F_SETLK)` risks multiple instances of rustc inside the same process acquiring a lock on the same file even when an exclusive lock is requested. Using `File::*lock*()` also allows removing a fair amount of platform specific code for the file locking.
Fixes https://github.com/rust-lang/rust/issues/161361
move bug and span_bug macros to rustc_span
This allows them to be used without depending on rustc_middle.
This is done by using a rustc_interface callback so that, if the callback is set, a internal compiler error diagnostic is printed through that. After that the panic is initiated.
r? @jdonszelmann @bjorn3