moves rustc_legacy_const_generics checks into attribute parsing
Part of rust-lang/rust#153101.
Moves the remaining `#[rustc_legacy_const_generics]` validation from `rustc_passes::check_attr` into `RustcLegacyConstGenericsParser::finalize_check`.
The three associated diagnostics are moved into `rustc_attr_parsing`, and the old check is removed from `check_attr.rs`.
Diagnostic messages and spans are preserved.
Update GitHub Actions to v26
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [ubuntu](https://redirect.github.com/actions/runner-images) | github-runner | major | `24.04` → `26.04` |
| [ubuntu](https://redirect.github.com/actions/runner-images) | github-runner | major | `24.04-arm` → `26.04-arm` |
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/rust).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Bump Windows CI LLVM to 22.1.8
It's fallen a bit behind the linux runners. Also needed for running `tests/debuginfo` on windows CI runners (https://github.com/rust-lang/rust/pull/163090)
Skip optional asserts in SsaRangePropagation
Fixes https://github.com/rust-lang/rust/issues/163779.
Is it normal to have a mir-opt diff without any diff in it? I think it communicates what I want in this case, that the pass does nothing to this code.
rustc_ast_lowering: track implicit Self via explicit flag instead of name
fixesrust-lang/rust#163457
& added a ui regression test for the reported reproducer.
r? @bjorn3
make semicolon_in_expressions_from_non_local_macros not report-in-deps
See rust-lang/rust#162872 for context. This new lint was made immediately report-in-deps without a crater run. I guess people assumed that the ecosystem fallout would be small, but no data was gathered to confirm that hypothesis. We now have data showing that the ecosystem fallout is [gigantic](https://github.com/rust-lang/rust/pull/162768#issuecomment-5833566434), so let's remove the report-in-deps from this lint.
This should be backported to the 1.100 beta. (1.99 already has this patch.)
Cc @joshtriplett
lower spans of error const args and test binder bounds
fixesrust-lang/rust#163592
lower spans when constructing hir nodes for error const args and test binder bound type constraints, these paths were using raw ast spans instead of routing them through `lower_span`
(reproduce with `rust.debug-assertions = true` and `-Cincremental`; the tests listed in the issue now pass.)
r? @bjorn3
cc @matthiaskrgr
cg_llvm: Use `LLVMGlobalAddMetadata` from LLVM-C
- Follow-up to https://github.com/rust-lang/rust/pull/163572
---
`LLVMGlobalAddMetadata` was introduced in LLVM 22, so now that that's our baseline, we can bind to it directly and remove our own C++ wrapper.
optimize empty `NestedGoals::extend_from_child`
we sometimes get incredibly big `nested_goals` from large and involved cycles. When propagating them outwards, we currently manually build a `HashMap` by accessing an entry for every nested goal of the child. This is unnecessary.
This does not help with the max-rss regression in https://github.com/rust-lang/rust/issues/161660, but should help with perf in such cases.
r? types
Use a loop to avoid emitting long sequences of retags.
See MCP [#958](https://github.com/rust-lang/compiler-team/issues/958) for context on `-Zcodegen-emit-retag`.
If we need to retag an array of references, then we will retag every element of the array. This does not scale for large arrays. For example:
```rust
const N: usize = 100_000;
fn example(array: [&u32; N]) {}
fn main() {
example([&0; N]);
}
```
This program will cause `rustc` to hang at `-O0` with `-Zcodegen-emit-retag`. In the body of `example`, we need to ensure that every element of `array` receives a function-entry retag, so we emit 100,000 retag function calls within a single basic block!
This PR fixes this issue by adjusting how we retag the contents of arrays. Instead of retagging ever element in succession, we emit a loop that applies a single retag call to every element of the array. I have tested it on BorrowSanitizer's test suite.
Also, I saw the new `#FIXME` comment about supporting `repr(simd)` types. Some of the changes that I made here will be helpful for fixing that issue in a subsequent PR.
cc: @mojeanmac
r? @saethlin
Fix relative extern URL depth on source pages
Source pages with `--extern-html-root-url` pointing to a relative URL like `../` were generating links with one extra `../`. So instead of `../../core/iter/index.html` you'd get `../../../core/iter/index.html`. Took a while to notice because `htmldocck.py` uses substring matching — `../../core/` is a substring of `../../../core/` so the test passed anyway.
Two root causes. `remote_url_prefix` was using `cx.current.len()` for depth, but during source rendering `cx.current` is empty — `SourceCollector` doesn't do module descent. Source pages live under `src/<crate_name>/` so the real depth is 2, not 0. On top of that, `make_href` was trying to compensate by prepending `root_path` to relative remote URLs (there was a FIXME about this), which just made it worse — `../../` + `../core/iter/` = `../../../core/iter/`.
Fix: added `remote_item_depth(root_path, doc_depth)` that counts `../` segments in `root_path` when present, falls back to `doc_depth` otherwise. With the right depth in `remote_url_prefix`, `make_href` no longer needs to touch remote URLs at all — so `url_parts` now returns `is_remote = true` for all `Remote` locations. Also renamed `is_absolute` → `is_remote` since the semantics were always about "don't modify this URL", not about whether it has a scheme.
Added `!has` assertions to the test so the wrong URL gets caught explicitly next time.
Follow-up to rust-lang/rust#152977.
r? @notriddle
Stabilize `debug_closure_helpers`
Resolvesrust-lang/rust#117729. The tracking issue still needs an FCP, but I'm hoping that creating a stabilization PR will prompt one.
r? libs-api
Annotate MIR with dataflow results for testing purposes
When requested through an internal rustc attribute, include dataflow
results in MIR output, i.e., `-Zunpretty=mir` or `--emit mir`.
For now, supported dataflows are:
* `#[rustc_mir(rustc_pretty_live_locals)]`
* `#[rustc_mir(rustc_pretty_transitive_live_locals)]`
The mechanism is intended to supersede existing `rustc_peek` intrinsic.
For demonstration also migrates one of tests based on `rustc_peek`:
tests/ui/mir-dataflow/liveness-projection.rs.