Add regression tests for two fixed issues
This PR adds two regression tests for two ICE issues that have been identified as fixed and marked with E-needs-test.
Closesrust-lang/rust#148096.
Closesrust-lang/rust#148620.
Fix the stale metrics directory warning
The warning emitted when RUSTC_ICE overrides -Zmetrics-dir referenced
the nonexistent -Zerror-metrics option. Use the actual option name and
cover the warning text in the existing run-make test.
Fix safety doc in intrinsics::simd
The Safety documentation for `simd_gather` and `simd_scatter` incorrectly described unmasked values in `T` as requiring readable or writable memory.
The memory access is performed through the corresponding enabled pointer lane in `ptr`, so this updates the documentation to state that requirement explicitly.
tidy: document u64 limit for numeric sort keys
The `tidy-alphabetical` checker uses natural sorting for numeric sequences, parsing each sequence as `u64`.
Document this limit so that numeric sequences in marked lists remain within the supported range.
Shorten types more when only interesting part is lifetimes
We have a mechanims (`Highlight`) to change the name of inferred lifetimes in types so that we can refer to them by a number. Modify it so that it also avoids printing sub-parts of the type that are irrelevant to the situation at hand. The new behavior will print any sub part that has *any* lifetime (as they might be informative) instead of *just* the lifetimes being replaced. This was found to produce the best effect empirically in the test suite, striking a nice balance between shortening labels and being informative.
```
error: lifetime may not live long enough
--> $DIR/wrong-closure-arg-suggestion-125325.rs:46:18
|
LL | take(|_| to_fn(|_| self.counter += 1));
| --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
| | |
| | return type of closure `aux::Map<{closure@...}>` contains a lifetime `'2`
| lifetime `'1` represents this closure's body
|
= note: closure implements `Fn`, so references to captured variables can't escape the closure
```
```
error: implementation of `FnOnce` is not general enough
--> $DIR/higher-ranked-auto-trait-15.rs:20:5
|
LL | require_send(future);
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
|
= note: closure with signature `fn(&'0 _) -> Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
= note: ...but it actually implements `FnOnce<(&Vec<i32>,)>`
```
Made this change after noticing that the first of the errors above had a corresponding `.stderr` file with lines longer than 150 columns by using `rg ".. \| .{150}" -g *.stderr`.
Port compiletest's CLI to clap
Suggested this in https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/compiletest.20CLI.20parsing/with/609693929.
My main motivation was to separate CLI arguments and the `Config` structure, because we derive a lot of non-CLI data for the latter struct, but before it was too tied to the CLI.
This PR is the first step towards that, in follow-up PRs I will clean up the `Config`.
The move itself was *very* boilerplate-y, so I decided to use Claude to perform the mechanical port (the first commit).
Then I went through all the flags, checked that they correspond to the old ones and should be parseable by clap.
I also did some light cleanups to remove extra parsing there.
This is in the second commit (no AI was involved in that).
This PR increases the dependency count of `compiletest` by 4. I think that's fine, and on CI it should be cached by `sccache` anyway.
r? @jieyouxu
Update Rust crate rkyv to v0.8.16 [SECURITY]
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [rkyv](https://redirect.github.com/rkyv/rkyv) | dependencies | patch | `0.8.15` → `0.8.16` |
---
### rkyv: Panic safety bugs in `InlineVec::clear` and `SerVec::clear` enable arbitrary code execution
[GHSA-vfvv-c25p-m7mm](https://redirect.github.com/advisories/GHSA-vfvv-c25p-m7mm)
<details>
<summary>More information</summary>
#### Details
`InlineVec::clear()` and `SerVec::clear()` in `rkyv` were not panic-safe. Both functions iterate over their elements and call `drop_in_place` on each, updating `self.len` only *after* the loop. If an element's `Drop` implementation panics during the loop, `self.len` is left at its original value.
A subsequent invocation of `clear()` on the same container then re-visits the already-freed elements:
- `InlineVec::clear()` is called again from `InlineVec`'s own `Drop` implementation when the value is later dropped.
- `SerVec::clear()` is called again by `SerVec::with_capacity()` after the user closure returns.
##### Technical Impact
- **CWE-415 (Double Free):** Heap corruption when element type holds `Box<T>`
- **CWE-416 (Use-After-Free):** Memory corruption when element reads from heap during `Drop`
Both vulnerabilities are triggerable entirely from safe Rust via `std::panic::catch_unwind` and require no special privileges.
#### Severity
- CVSS Score: 6.9 / 10 (Medium)
- Vector String: `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N`
#### References
- [5828cf5c27)
- [https://rustsec.org/advisories/RUSTSEC-2026-0122.html](https://rustsec.org/advisories/RUSTSEC-2026-0122.html)
- [https://github.com/advisories/GHSA-vfvv-c25p-m7mm](https://redirect.github.com/advisories/GHSA-vfvv-c25p-m7mm)
This data is provided by the [GitHub Advisory Database](https://redirect.github.com/advisories/GHSA-vfvv-c25p-m7mm) ([CC-BY 4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>
---
### Release Notes
<details>
<summary>rkyv/rkyv (rkyv)</summary>
### [`v0.8.16`](https://redirect.github.com/rkyv/rkyv/compare/0.8.15...0.8.16)
[Compare Source](https://redirect.github.com/rkyv/rkyv/compare/0.8.15...0.8.16)
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- 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 this update 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:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjUuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI2NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Explicitly materialize debuginfo tests for all debuggers
When testing https://github.com/rust-lang/rust/pull/158298, I realized that when you don't have a given debugger (CDB, GDB, LLDB) available, compiletest will silently skip generating "variants" of debuginfo tests for a given debugger. So if you run a single debuginfo test, it will run 0/1/2/3 tests, based on what debuggers you have available. So it will show `running 1/2/3 tests` without telling you that it is actually three separate tests, but some of them were automatically ignored.
This is made even worse by the fact that bootstrap/compiletest currently automatically discovers debuggers, so there is a lot of implicit behavior stacked on top of each other.
This PR changes that, so that compiletest *always* creates all three variants of the tests, but if you don't have a debugger X available, then the X variant will be ignored, so you can see clearly in the output that it was ignored and why, which is much better than the test simply disappearing.
So after running a given debuginfo test, you will see e.g. this:
```
running 3 tests
test [debuginfo-cdb] tests/debuginfo/basic-types.rs ... ignored, cdb is not available
test [debuginfo-gdb] tests/debuginfo/basic-types.rs ... ok
test [debuginfo-lldb] tests/debuginfo/basic-types.rs ... ok
```
Which makes it more more obvious that there are in fact three separate tests, but some of them are ignored (and why).
The way this is achieved is a bit hacky, but that is caused by the previous way compiletest did things. To simulate the three variants of each debuginfo test, compiletest currently generates a separate instance (!) of the `Config` for each debugger, in the `run_tests` function. That's quite hacky, to say the least, and it requires storing a `debugger` field in the `Config`, which specifies for which variant we are currently running the debuginfo test.
I wanted to try using a single config, and encoding the CDB/GDB/LLDB variants as revisions instead. However, I found out that some debuginfo tests actually do use revisions for.. actual revisions, which caught me by surprise. So we would either need to expand the set of used revisions, so that if the test has e.g. `revision=lto`, `revision=no-lto`, we would then turn that into:
- `revision=lto-cdb`
- `revision=lto-gdb`
- `revision=no-lto-cdb`
- `revision=no-lto-gdb`
- `revision=no-lto-lldb`
That's maybe not such a bad solution, and it would allow us to use a single `Config` instance, but it would also require either encoding the debugger inside the revision string and then parsing it out (ugh), or turning revisions into a struct that would contain multiple information (such as the debugger used and then the revision name).
Or we could introduce a separate mechanism for "multiplying" tests, but we already have revisions, and it seems overkill to introduce something like this only for debuggers (unless it is also needed at other places...).
So what I did in this PR instead is to keep the three separate configs, but rather than not generating the Config when a debugger is missing, we *always* generate a separate config for each debugger, but then we ignore tests that do not match the "active" debugger in the Config. Because this ignore logic is not per directive line, but per test, so I had to introduce a new block of code that does that, but that seems fine to me, when compared to the mountain of hacks already present in this part of the codebase xD
This is implemented in the second commit, the first commit is just a small simplification refactoring.
r? @jieyouxu
Fixes: https://github.com/rust-lang/rust/issues/126628
Rollup of 3 pull requests
Successful merges:
- rust-lang/rust#159028 (fuchsia: Ensure all existing ported sanitizers for Fuchsia are supported)
- rust-lang/rust#159339 (Resolver: extract `use_injections` out of main `Resolver`)
- rust-lang/rust#159342 (renovate: group github actions updates)
Resolver: extract `use_injections` out of main `Resolver`
Prep work for rust-lang/rust#158845. Extract the `use_injections` field out of the resolver and into the `LateResolutionVisitor`. It can then be passed into the `report_errors` pass, so no behaviour is changed.
This allows the `Resolver` to be `DynSync`, see https://github.com/rust-lang/rust/pull/158845#discussion_r3579712892.
r? @petrochenkov
Add `proc_macro` attribute documentation
part of https://github.com/rust-lang/rust/issues/157604
r? @GuillaumeGomez
cc: @fmease
(I wasn't sure who to exactly tag. I see several PR's switch between you two)
std: upgrade `addr2line`, `object`, `miniz_oxide`
The `addr2line` upgrade also upgrades `gimli`, and we need a new
`unwinding` to align on that. No code changes are required.
See also rust-lang/backtrace-rs#765, but since `std` uses that as a
`#[path] mod backtrace_rs`, we don't need to wait for the crate update.
Emit more targeted diagnostics when an input file cannot be opened,
including dedicated messages for common error kinds and typo
suggestions for missing files. Add run-make tests covering NotFound,
PermissionDenied, IsADirectory, and non-existent directory cases.
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>