Abby: rename and move solver constraint storage to be constraint data
r? khyperia
cc @adwinwhite
Instead of having a `SolverRegionConstraintStorage` which exists at the top level in `InferCtxtInner` next to legacy handling's `RegionConstraintStorage`, we rename to `SolverRegionConstraintData` and move it into `RegionConstraintStorage` alongside the legacy `RegionConstraintData`.
This more accurately reflects that when we talk about "merging" legacy and abby constraints into one, it means replacing `RegionConstraintsData` with `SolverRegionConstraintsData`, *not* getting rid of everything else in `RegionConstriantStorage` (many of the fields in there are used under abby and will continue to be used).
This cleanup should also make it easier to do future cleanups like making the lub/sub/eq/etc methods actually work correctly under abby instead of silently doing nothing ✨ In theory there shouldn't be any behaviour changes from this PR
point at the opaque when its hidden type cannot be inferred
the note added in https://github.com/rust-lang/rust/pull/162172 now points at the opaque definition, unless the error already points inside it.
r? @lcnr
fix issue number for feature(unsized_const_params)
was looking at the unstable-book page for unsized_const_params and had a rough time finding the tracking issue for it (the current issue number links to adt_const_params, not unsized_const_params)
for context, the tracking issue was created a couple days after https://github.com/rust-lang/rust/pull/127722 merged, and it hasn't been touched since
r? @BoxyUwU
Remove the `span_use_eq_ctxt` lint
PR 163857 changed the span representation and reduced `eq_ctxt` to a trivial equality check, which means `span_a.ctxt() == span_b.ctxt()` is now an ok alternative to `span_a.eq_ctxt(span_b)`.
This commit removes `span_use_eq_ctxt` because it's no longer necessary. `eq_ctxt` remains because removing it would cause some churn; it might be worth doing as a follow-up.
r? @Kivooeo
Add regression test for #155977
The ICE was fixed by rust-lang/rust#156976. I checked the final test on its base build, `3c00c96d` (ICE), and its unrolled build, `5d29849f` (E0277, no ICE).
The test checks that this higher-ranked where-clause example fails to compile instead of causing an ICE in the new trait solver.
Closesrust-lang/rust#155977
cc @lcnr
rustdoc: Improvements for `rustc_must_implement_one_of`
Fixes https://github.com/rust-lang/rust/issues/163675.
Funnily enough, most things are actually already there, so this PR is only an improvement over the following:
* The methods listed in the note are now links.
* The note itself got a little display improvement (unified with the existing ones mostly, screenshots below).
* Added the `Required Methods` heading in the sidebar if `rustc_must_implement_one_of` is used
Before:
<img width="407" height="114" alt="Screenshot From 2026-10-13 16-30-39" src="https://github.com/user-attachments/assets/ccbe09bd-437a-45ab-a6ae-e77f02c68b19" />
After:
<img width="454" height="121" alt="Screenshot From 2026-10-13 16-30-47" src="https://github.com/user-attachments/assets/62b4e7a7-b727-4e25-ade4-7e530fd110cb" />
r? @Urgau
Windows FileExt trait doesn't need to handle ErrorKind::Interrupted; test improvements for same
This PR:
* Fixes the Windows `FileExt` `seek_read_exact()`, `seek_read_buf_exact()`, and `seek_write_all()` methods to pass up *all* errors as `ErrorKind::Interrupted` does not occur natively on Windows
* Adds a new test to make sure `ErrorKind::Interrupted` is handled correctly
* Cleans up existing tests and adds call counting checks
No LLMs were used in writing this PR.
Um, no Windows were locally used in writing this PR, either. I did my best with GitHub's CI to make sure these test work, but... can BORS be made to do a Windows only test on this PR first? I don't want to be the one messing up the merge again, haha.
document some quirks around directory symlinks on Windows
We manage to almost entirely paper over the fact that Windows symlinks are very different from Unix symlinks in the portable `std::fs` methods... except for the case of removing a directory symlink, which requires different operations on Windows vs Unix.
Cc @ChrisDenton @the8472
Parse move exprs as a bottom expr instead of a prefix expr
`move(…)` is obviously meant to be a normal expr but since it was incorrectly treated as a prefix expr in the compiler, it meant it couldn't be used as the (left) operand of what I personally call "higher postfix operations"[^1], namely *Try*, *Call* / *Index* & "*Dot*" (*Field*, *Await*, …).
More concretely, it would mean we'd reject expressions like `move(…)?` (*Try*), `move(…)(…)` (*Call*), `move(…)[…]` (*Index*), `move(…).field` (*Field*), `move(…).method(…)` (*MethodCall*) or `move(…).await` (*Await*).
Furthermore, it would mean we'd parse `return move(0).field` like `(return move(0)).field` instead of `return ((move(0)).field)`.
---
It's immaterial whether the final version of move exprs continues to use syntax `move(…)` (a syntax much contended over at the RFC) or if it gets changed along the way (to e.g., `move { … }` (also quite controversial)), it remains a fact that move exprs are not prefix exprs!
---
CC @TaKO8Ki @nikomatsakis (https://github.com/rust-lang/rust/pull/155023)
Part of https://github.com/rust-lang/rust/issues/155050.
<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
[^1]: I.e., operations where the corresponding operator precedence is higher than or equal to the one of *Try*.
Fix fudging
r? @lcnr
This PR adds a postprocessing step to fudging: after fudging, any changes from the formal input type to the expected input type are only kept, if they result in structural changes. If the only change is one inference variable changing to another (fresh) inference variable, the formal one is kept, not the fresh one. This avoids cases in which those fresh inference variables are *less* constrained than the original formal ones, and making them fresh has no benefit.
Fixes https://github.com/rust-lang/rust/issues/161913
Fixes https://github.com/rust-lang/rust/issues/118603
> [!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.
test DSL eagerly handle false constraints
For Context: https://github.com/rust-lang/project-assumptions-on-binders/issues/57
Changelog:
After getting the `constraints`, I immediately check whether it’s `false`, and if so, report an error right away. The issue mentions two places: one is when `forall` as a whole returns false, and the other is when there’s a `false constraints` at the top level. So the changes to `wfcheck.rs` cover both cases.
For the latter, maybe need to clear the existing `constraints`; otherwise it reports "higher-ranked lifetime bound could not be satisfied". I clear them by overwriting with `new_true`. I considered saving the old value and restoring it afterwards, but I think that’s more trouble than it’s worth. :)
finally, I added relevant test files following the pattern of other test files, and they pass.
llm disclosure: everything related to this issue was handwritten by me, with no LLM assistance.
thank you for your time!
Implement better resolution for delegation `Self` mapping field
Connects a `Self` mapping field with a `FieldDef` during typecheck to support more cases: `struct W(S)`, `struct W { s: S }`.
Part of rust-lang/rust#118212.
r? @petrochenkov
Prefer WriteConsoleW for stdout on Windows
This PR reverts rust-lang/rust#159562 and changes stdout on Windows such that
all writes use `WriteConsoleW` _if_ stdout refers to a console.
This drops the `GetConsoleOutputCP` call, which would otherwise do an
RPC to the console server (= slow). This leaves us with `is_console`
which was using another RPC via `GetConsoleMode` (= doubly slow).
On Windows 8+ we can just use `NtQueryVolumeInformationFile()` to test
for `FILE_DEVICE_CONSOLE`, resulting in a ~2x console stdout speedup.
### Linewise output of `RELEASES.md`:
Output | Version | lines/s | MB/s | Speedup
--------|----------|--------:|------:|--------
console | 1.99.0 | 31526 | 1.79 |
console | nightly | 29251 | 1.66 |
console | **this** | 67294 | 3.82 | 2.13x
`NUL` | 1.99.0 | 784311 | 44.50 |
`NUL` | nightly | 776529 | 44.06 |
`NUL` | **this** | 1141618 | 64.78 | 1.46x
The console output speedup is very noticeable here,
as the time to run drops from 0.6s to just 0.25s.
### 128KiB chunked passthrough of `enwik8`:
Output | Version | MB/s | Speedup
--------|----------|--------:|--------
console | 1.99.0 | 86.99 |
console | nightly | 165.27 | 1.90x
console | **this** | 165.61 | 1.90x
`NUL` | 1.99.0 | 1123.82 |
`NUL` | nightly | 1137.30 |
`NUL` | **this** | 1289.35 |
The limiting factor here is `MAX_BUFFER_SIZE` which
deserves to be refactored in another PR in my opinion.
Add a new `rustc_show_spans` internal attribute
This new internal attribute is a first step for solving rust-lang/rust#126763.
Given the code:
```rust
#![feature(rustc_attrs)]
mod x { pub const Y: u8 = 1; }
macro_rules! path { ($a:tt, $b:tt) => { let _ = $a::$b; }; }
#[rustc_show_spans(path)]
fn no_macro() { let _ = x::Y; }
#[rustc_show_spans(path)]
fn path_bug() { path!(x, Y); }
```
We can now report the spans and thus show the bug of the span not falling inside the macro context:
```
note: showing the spans of the path
--> test.rs:8:25
|
8 | fn no_macro() { let _ = x::Y; }
| ^^^^
note: showing the spans of the path
--> test.rs:11:23
|
11 | fn path_bug() { path!(x, Y); }
| ^^^^
```
r? @petrochenkov
Recover missing `turbofish` for `lifetime` arguments in expression position
Fixesrust-lang/rust#162656.
`Struct<'a> { .. }` and `f<'_>()` were parsed as a `<` comparison whose RHS is a label, producing a cascade of unrelated errors. `parse_path_segment` now accepts `<` followed by a lifetime and `>`/`,` in expression paths, emits one "use `::<...>`" suggestion, and parses the args normally.Since the recovery is inside the path parser, `path.span` and chained forms (`::new()`, `.method()`, `?`) work without AST fix-ups or new `Parser` state; it is guarded by `may_recover()`.
cc @estebank
Update cargo submodule
14 commits in 29c5daa1afc262323364e039bb70c83372cc702c..3960fa69bb617e3d93c4ddc087c1b32bf12ad907
2026-10-07 22:13:48 +0000 to 2026-10-12 19:29:05 +0000
- refactor: modernize some API usages for 1.99 (rust-lang/cargo#17584)
- Removed some dead workspace tests (rust-lang/cargo#17582)
- Bypass rustup proxy when RUSTUP_TOOLCHAIN is an absolute path (rust-lang/cargo#17562)
- chore: Add an LLM disclosure to the PR template (rust-lang/cargo#17580)
- Restrict workspace-relative dep-info to workspace packages (rust-lang/cargo#17575)
- fix(layout): exclude a build-dir created as a parent from backups (rust-lang/cargo#17560)
- Avoid absolute paths in fingerprints if they are relative to the workspace root (rust-lang/cargo#17573)
- chore(deps): update msrv (3 versions) to v1.97 (rust-lang/cargo#17572)
- fix(job): Allow explicit child process breakaway on Windows (rust-lang/cargo#17527)
- fix(git): Add future-incompat warning in prep for removing auto-detection (rust-lang/cargo#17568)
- fix(config): Don't process includes for `credentials.toml` files (rust-lang/cargo#17569)
- doc(builtin-dep): Document the builtin package ID spec format (rust-lang/cargo#17564)
- test(mock-std): Set stable crate versions to 0.0.0 (rust-lang/cargo#17565)
- Fix: cargo installing from a directory source fails for binary packages with no dependencies. (rust-lang/cargo#17552)
r? ghost
This drops the `GetConsoleOutputCP` call, which would otherwise do an
RPC to the console server (= slow). This leaves us with `is_console`
which was using another RPC via `GetConsoleMode` (= doubly slow).
On Windows 8+ we can just use `NtQueryVolumeInformationFile()` to test
for `FILE_DEVICE_CONSOLE`, resulting in a ~2x console stdout speedup.
PR 163857 changed the span representation and reduced `eq_ctxt` to a
trivial equality check, which means `span_a.ctxt() == span_b.ctxt()` is
now an ok alternative to `span_a.eq_ctxt(span_b)`.
This commit removes `span_use_eq_ctxt` because it's no longer necessary.
`eq_ctxt` remains because removing it would cause some churn; it might
be worth doing as a follow-up.
perf: drop error in `unwrap_failed` instead of `unwrap`
Context: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/40-byte.20copy.20of.20unwrapped.20Result.3CT.2C.20.28.29.3E.20payload.20survives.20-O3/with/630360641
This PR changes `Result::unwrap` to pass the error by value into `unwrap_failed` rather than by reference. This makes `unwrap` no longer responsible for dropping the error after `unwrap_failed` panics, which reduces code size and compilation times and enables MIR-inlining of `unwrap`.
The downside is that it introduces another function that must be monomorphized per error type (though the formatting part stays polymorphic); but it turned out to be a net perf win. I tried keeping the `unwrap_failed` fully polymorphic by passing the error as `&mut ManuallyDrop<dyn Debug>`, but this turned out to be worse for performance.
[The first perf run](https://github.com/rust-lang/rust/pull/164059#issuecomment-6090859813) matches the current state of this PR ([the second one](https://github.com/rust-lang/rust/pull/164059#issuecomment-6093489095) is for the ManuallyDrop implementation that turned out to be slower).
Generated code comparison (with an example of an error that has a destructor so that the landing pad shows up in the assembly post-LLVM): https://rust.godbolt.org/z/ajjYMTc7Y
Old:
```asm
push r14
push rbx
sub rsp, 24
cmp qword ptr [rsi], -1
je .LBB5_1
mov rax, qword ptr [rsi + 16]
mov qword ptr [rdi + 16], rax
movups xmm0, xmmword ptr [rsi]
movups xmmword ptr [rdi], xmm0
mov rax, rdi
add rsp, 24
pop rbx
pop r14
ret
.LBB5_1:
mov eax, dword ptr [rsi + 8]
mov dword ptr [rsp + 4], eax
lea rdi, [rip + .Lanon.99b5833966418e083b8bdda9f0bfd3cb.1]
lea rcx, [rip + .Lanon.99b5833966418e083b8bdda9f0bfd3cb.0]
lea r8, [rip + .Lanon.99b5833966418e083b8bdda9f0bfd3cb.8]
lea r14, [rsp + 4]
mov esi, 43
mov rdx, r14
call qword ptr [rip + core[a9090a07a7fa7517]::result::unwrap_failed@GOTPCREL]
ud2
mov rbx, rax
mov qword ptr [rsp + 8], r14
mov rax, qword ptr [rip + <i32 as core[a9090a07a7fa7517]::fmt::Display>::fmt@GOTPCREL]
mov qword ptr [rsp + 16], rax
lea rdi, [rip + .Lanon.99b5833966418e083b8bdda9f0bfd3cb.11]
lea rsi, [rsp + 8]
call qword ptr [rip + std[c29fa2d9dbea2b0e]::io::stdio::_print@GOTPCREL]
mov rdi, rbx
call _Unwind_Resume@PLT
call qword ptr [rip + core[a9090a07a7fa7517]::panicking::panic_in_cleanup@GOTPCREL]
```
New:
```asm
example[32c4274de85e6574]::generic::unwrap:
cmp qword ptr [rsi], -1
je .LBB7_2
mov rax, qword ptr [rsi + 16]
mov qword ptr [rdi + 16], rax
movups xmm0, xmmword ptr [rsi]
movups xmmword ptr [rdi], xmm0
mov rax, rdi
ret
.LBB7_2:
push rax
mov edx, dword ptr [rsi + 8]
lea rdi, [rip + .Lanon.99b5833966418e083b8bdda9f0bfd3cb.1]
lea rcx, [rip + .Lanon.99b5833966418e083b8bdda9f0bfd3cb.10]
mov esi, 43
call example[32c4274de85e6574]::generic::unwrap_failed::<example[32c4274de85e6574]::Error>
```
Support function args const generics
This PR adds initial support for argument-position const generics behind the `function_arg_const_generics` feature gate.
It allows const generics to be declared directly in function arguments. The PR adds the basic plumbing across AST, HIR, and `ty`, parses these parameters into the function's generics, lowers call arguments into consts. For now, we lower literals, negated literals, const parameters, const items, unit variants, and etc, This works for functions, methods and a couple of more cases.
r? @BoxyUwU
cc: @khyperia
Fix expected output for x86-64-sysv64-arg-ext.apple.stderr
This fixes test failures Chromium saw as a result of rust-lang/rust#156112, since x86 apple bots are tier 2 I understand that support is best effort.
Used `--bless` for the test output on an apple silicon mac, but I did run this on an x86 mac bot and the test succeeded.
Ignore thread-related tests for UEFI
- UEFI is does not have threads. So skip tests that need threads to compile/run.
- Encountered when running Rust test suite for UEFI target.
Add regression test for dead-code with external trait impl
Hi, this is my first contribution! :)
This PR adds a regression UI test for and closesrust-lang/rust#142541 .
I checked the test fails before c93fac7d64 (from rust-lang/rust#142485) and passes on current main.
make `with_post_analysis_normalized` invalidate rigid aliases
Tracking typing env transition is necessary for rigid aliases to be correct. However, it's quite brittle and requires much care to deal with.
We now remind compiler devs to invalidate their rigid aliases when entering `PostAnalysis` typing mode via `with_post_analysis_normalized`. Basically they need to fold data that's carried across the typing env transition.
See the comments on `with_post_analysis_normalized_invalidating_rigid_aliases` for details.
The tests are taken from https://gist.github.com/lcnr/e173ec9238fcbdd62b14320cb3b9864d
It's planned to generalize this pattern to other constructors in followups since they're less straightforward.
r? lcnr