Rollup of 8 pull requests
Successful merges:
- #103367 (Remove std's transitive dependency on cfg-if 0.1)
- #103397 (Port `dead_code` lints to be translatable.)
- #103681 (libtest: run all tests in their own thread, if supported by the host)
- #103792 (Migrate `codegen_ssa` to diagnostics structs - [Part 2])
- #103897 (asm: Work around LLVM bug on AArch64)
- #103937 (minor changes to make method lookup diagnostic code easier to read)
- #103958 (Test tidy should not count untracked paths towards entries limit)
- #103964 (Give a specific lint for unsafety not being inherited)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Give a specific lint for unsafety not being inherited
In cases like
```rs
static mut FOO: u64 = 0;
fn main() {
unsafe {static BAR: u64 = FOO;}
}
```
and
```rs
fn foo() {
unsafe {
fn bar() {
unsafe_call();
}
}
}
```
Specifically inform the user that the unsafety is not inherited for the seperate enclosing items
Fixes#94077
r? compiler-errors
`@rustbot` label +A-diagnostics
minor changes to make method lookup diagnostic code easier to read
The end result of around 4 days of trying to understand this 1000+ line long function- a bunch of tiny nitpicks
r? `@compiler-errors`
asm: Work around LLVM bug on AArch64
Upstream issue: https://github.com/llvm/llvm-project/issues/58384
LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.
libtest: run all tests in their own thread, if supported by the host
This reverts the threading changes of https://github.com/rust-lang/rust/pull/56243, which made it so that with `-j1`, the test harness does not spawn any threads. Those changes were done to enable Miri to run the test harness, but Miri supports threads nowadays, so this is no longer needed. Using a thread for each test is useful because the thread's name can be set to the test's name which makes panic messages consistent between `-j1` and `-j2` runs and also a bit more readable.
I did not revert the HashMap changes of https://github.com/rust-lang/rust/pull/56243; using a deterministic map seems fine for the test harness and the more deterministic testing is the better.
Fixes https://github.com/rust-lang/rust/issues/59122
Fixes https://github.com/rust-lang/rust/issues/70492
Port `dead_code` lints to be translatable.
This adds an additional comma to lists with three or more items, to be consistent with list formatters like `icu4x`.
r? `@davidtwco`
Add QEMU test for x86_64-unknown-uefi
The UEFI targets don't have std support yet, so the normal tests don't work. However, we can compile a simple no-std program and run it under QEMU to at least check that the target compiles, links, and runs.
Tested locally with: `src/ci/docker/run.sh x86_64-uefi`
Fix ICE when negative impl is collected during eager mono
```rust
trait Foo {
fn foo() {}
}
impl !Foo for () {}
```
This code will currently cause an ICE when mono collection mode is "eager" (with `-C link-dead-code=y` or `-Z print-mono-items=eager`.
Remove rustdoc clean::Visibility type
Fixes#90852.
Follow-up of https://github.com/rust-lang/rust/pull/103690.
This PR completely removes the rustdoc `clean::Visibility` type to use the `rustc_middle` one instead. I don't think there will be any impact on perf.
r? `@notriddle`
Fix late-bound lifetime closure ICEs in HIR typeck and MIR borrowck
During HIR typeck, we need to teach astconv to treat late-bound regions within a closure body as free, fixing escaping bound vars ICEs in both of the issues below.
However, this then gets us to MIR borrowck, which itself needs to be taught how to instantiate free region vids for late-bound regions that come from items that _aren't_ the typeck root (for now, just closures).
Fixes#103771Fixes#103736
asm: Match clang behavior for inlateout fixed register operands
We have 2 options for representing LLVM constraints for `inlateout` operands on a fixed register (e.g. `r0`): `={r0},0` or `={r0},{r0}`.
This PR changes the behavior to the latter, which matches the behavior of Clang since https://reviews.llvm.org/D87279.
Add howto for adding new targets
When new targets are added, often a reviewer finds out that e.g. the target-3-tier-policy is not filled out (missing), there is no description etc.
This change adds a description of what I've learned while working on #102701. It should make reviews easier in the future with less rework.
r? compiler-team
Add visit_fn_ret_ty to hir intravisit
I'm working on some RPITIT changes and I need to specialize `visit_fn_ret_ty` in my visitor impl. So I guess it's better to land it separately.
r? `@compiler-errors`
FIX - StrippingDebugInfoFailed typo
DELETE - unneeded FIXME comment
UPDATE - only declare the error with ExtractBundledLibsError as an enum and use the Diagnostic derive macro