Rollup of 12 pull requests
Successful merges:
- #137337 (Add verbatim linker to AIXLinker)
- #137363 (compiler: factor Windows x86-32 ABI impl into its own file)
- #137537 (Prevent `rmake.rs` from using unstable features, and fix 3 run-make tests that currently do)
- #137606 (add a "future" edition)
- #137957 (Remove i586-pc-windows-msvc)
- #138000 (atomic: clarify that failing conditional RMW operations are not 'writes')
- #138013 (Add post-merge analysis CI workflow)
- #138033 (rustdoc: Add attribute-related tests for rustdoc JSON.)
- #138137 (setTargetTriple now accepts Triple rather than string)
- #138173 (Delay bug for negative auto trait rather than ICEing)
- #138184 (Allow anyone to relabel `CI-spurious-*`)
- #138187 (remove clones)
r? `@ghost`
`@rustbot` modify labels: rollup
rustdoc: Add attribute-related tests for rustdoc JSON.
Add rustdoc JSON tests covering the use of the following attributes:
- `#[non_exhaustive]` applied to enums, variants, and structs
- `#[must_use]`, both with and without a message
- `#[no_mangle]`, in both edition 2021 and 2024 (`#[unsafe(no_mangle)]`) flavors
- `#[export_name]`, also in both edition 2021 and 2024 flavors
Related to #137645; this is a subset of the attributes that `cargo-semver-checks` relies on and tests in its own test suite or in the test suites of its components such as `trustfall-rustdoc-adapter`.
Helps with #81359
r? `@aDotInTheVoid`
Add post-merge analysis CI workflow
This PR adds a post-merge analysis workflow, which was discussed [here](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Reporting.20test.20suite.20statistics.20after.20merge).
The workflow currently analyzes test suite results from bootstrap metrics. It downloads metrics for all known jobs in the parent and current (HEAD) commit, compares them and prints a truncated diff. It then posts this diff to the merged PR as a comment. Later I also want to add other statistics to the analysis, e.g. changes in CI/bootstrap step durations.
It can be tested locally e.g. using this:
```
cargo run --release --manifest-path src/ci/citool/Cargo.toml post-merge-report 3cb02729abfd17deacce
```
This uses a slightly older commit as a parent, to have more results in the diff (normally the diff won't be so large).
CC `@jieyouxu`
r? `@marcoieni`
atomic: clarify that failing conditional RMW operations are not 'writes'
Fixes https://github.com/rust-lang/rust/issues/136669
r? ``@Amanieu``
Cc ``@rust-lang/opsem`` ``@chorman0773`` ``@gnzlbg`` ``@briansmith``
Remove i586-pc-windows-msvc
See [MCP 840](https://github.com/rust-lang/compiler-team/issues/840).
I left a specialized error message that should help users that hit this in the wild (for example, because they use it in their CI).
```
error: Error loading target specification: the `i586-pc-windows-msvc` target has been removed. Use the `i686-pc-windows-msvc` target instead.
Windows 10 (the minimum required OS version) requires a CPU baseline of at least i686 so you can safely switch. Run `rustc --print target-list` for a list of built-in targets
```
``@workingjubilee`` ``@calebzulawski`` fyi portable-simd uses this target in CI, if you wanna remove it already before this happens
add a "future" edition
This idea has been discussed previously [on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Continuous.20edition-like.20changes.3F/near/432559262) (though what I've implemented isn't exactly the "next"/"future" editions proposed in that message, just the "future" edition). I've found myself prototyping changes that involve edition migrations and wanting to target an upcoming edition for those migrations, but none exists. This should be permanently unstable and not removed.
Prevent `rmake.rs` from using unstable features, and fix 3 run-make tests that currently do
Addresses (mostly) #137532.
Follow-up to #137373.
### Summary
- Fix 3 run-make tests that currently use unstable features:
1. `tests/run-make/issue-107495-archive-permissions/rmake.rs` uses `#![feature(rustc_private)]` for `libc` on `unix`, but `run_make_support` already exports `libc`, so just use that.
2. `tests/run-make/cross-lang-lto/rmake.rs` uses `#![feature(path_file_prefix)]` for convenience, replaced with similar filename prefix logic.
3. `tests/run-make/broken-pipe-no-ice/rmake.rs` uses `#![feature(anonymous_pipe)]` for anonymous pipes. This is more complicated[^race-condition], and I decided to temporarily introduce a dependency on [`os_pipe`] before std's `anonymous_pipe` library feature is stabilized[^pipe-stab]. I left a FIXME tracked by #137532 to make the switch once `anonymous_pipe` stabilizes and reaches beta.
- Use `RUSTC_BOOTSTRAP=-1` when building `rmake.rs` to have the stage 0 rustc reject any unstable features used in `rmake.rs`.
- The requirement that `rmake.rs` may not use any unstable features is now documented in rustc-dev-guide.
- This PR does not impose `RUSTC_BOOTSTRAP=-1` when building `run-make-support`, but I suppose we could.
r? `@Kobzol`
try-job: x86_64-msvc-1
try-job: x86_64-mingw-1
[`os_pipe`]: https://github.com/oconnor663/os_pipe.rs
[^race-condition]: We can't just try to spawn `rustc` and immediate close the stderr handle because of race condition, as there's no guarantee `rustc` will not try to print to stderr before the handle gets closed.
[^pipe-stab]: In-progress stabilization PR over at https://github.com/rust-lang/rust/pull/135822.
compiler: factor Windows x86-32 ABI impl into its own file
While it shares more than zero code with the SysV x86-32 ABI impl, there is no particular reason to organize wildly different ABIs using if-else in the same function.
Add verbatim linker to AIXLinker
This adds support for the "verbatim" native link modifier on AIX, will successfully pass the `native-link-modifier-verbatim-linker test case`
Rollup of 6 pull requests
Successful merges:
- #134797 (Ergonomic ref counting)
- #137549 (Clean up various LLVM FFI things in codegen_llvm)
- #137977 (Reduce `kw::Empty` usage, part 1)
- #138042 (Suggest struct or union to add generic that impls trait)
- #138141 (tests: fix some typos in comment)
- #138150 (Streamline HIR intravisit `visit_id` calls for items)
r? `@ghost`
`@rustbot` modify labels: rollup
Clean up various LLVM FFI things in codegen_llvm
cc ```@ZuseZ4``` I touched some autodiff parts
The major change of this PR is [bfd88ce](bfd88cead0) which makes `CodegenCx` generic just like `GenericBuilder`
The other commits mostly took advantage of the new feature of making extern functions safe, but also just used some wrappers that were already there and shrunk unsafe blocks.
best reviewed commit-by-commit
use target compiler on llvm-bitcode-linker
The build compiler is already resolved inside the `ToolBuild` step, so we should pass only the target compilers for `Mode::ToolRustc` tools.
Fixes https://github.com/rust-lang/rust/issues/138123
r? ghost
try-job: dist-powerpc64le-linux
Rollup of 6 pull requests
Successful merges:
- #137674 (Enable `f16` for LoongArch)
- #138034 (library: Use `size_of` from the prelude instead of imported)
- #138060 (Revert #138019 after further discussion about how hir-pretty printing should work)
- #138073 (Break critical edges in inline asm before code generation)
- #138107 (`librustdoc`: clippy fixes)
- #138111 (Use `default_field_values` for `rustc_errors::Context`, `rustc_session::config::NextSolverConfig` and `rustc_session::config::ErrorOutputType`)
r? `@ghost`
`@rustbot` modify labels: rollup
Rollup of 8 pull requests
Successful merges:
- #136667 (Revert vita's c_char back to i8)
- #137107 (Override default `Write` methods for cursor-like types)
- #137777 (Specialize `OsString::push` and `OsString as From` for UTF-8)
- #137832 (Fix crash in BufReader::peek())
- #137904 (Improve the generic MIR in the default `PartialOrd::le` and friends)
- #138115 (Suggest typo fix for static lifetime)
- #138125 (Simplify `printf` and shell format suggestions)
- #138129 (Stabilize const_char_classify, const_sockaddr_setters)
r? `@ghost`
`@rustbot` modify labels: rollup
Currently it relies on special treatment of `kw::Empty`, which is really
easy to get wrong. This commit makes the special case clearer in the
type system by using `Option`. It's a bit clumsy, but the synthetic name
handling itself is a bit clumsy; better to make it explicit than sneak
it in.
Fixes#133426.
Use `default_field_values` for `rustc_errors::Context`, `rustc_session::config::NextSolverConfig` and `rustc_session::config::ErrorOutputType`
Wanted to see where `#![feature(default_field_values)]` could be used in the codebase. These three seemed like no-brainers. There are a bunch of more places where we could remove manual `Default` impls, but they `derive` other traits that rely on `syn`, which [doesn't yet support `default_field_values`](https://github.com/dtolnay/syn/issues/1774).
Break critical edges in inline asm before code generation
An inline asm terminator defines outputs along its target edges -- a
fallthrough target and labeled targets. Code generation implements this
by inserting code directly into the target blocks. This approach works
only if the target blocks don't have other predecessors.
Establish required invariant by extending existing code that breaks
critical edges before code generation.
Fixes#137867.
r? ``@bjorn3``
Revert #138019 after further discussion about how hir-pretty printing should work
After some more discussion, #138019 was probably merged a little fast. Though there probably is a real bug in pretty printing, it is not feasible to add similar pretty printing routines for all attributes, and making this specific exception is likely not desired either. For more context, see post-merge comments on #138019
I kept the tests around, but reverted the hir-pretty change.
r? ```@compiler-errors```
library: Use `size_of` from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them.
These functions were added to all preludes in Rust 1.80.
try-job: test-various
try-job: x86_64-gnu
try-job: x86_64-msvc-1
Stabilize const_char_classify, const_sockaddr_setters
FCP for const_char_classify: #132241
FCP for const_sockaddr_setters: #131714Fixes#132241Fixes#131714
Cc ``@rust-lang/wg-const-eval``
Simplify `printf` and shell format suggestions
Simplify tracking `printf` and shell format suggestions. Although allocations could be deferred until after checking that they aren't already in the map, this style is simpler.
Improve the generic MIR in the default `PartialOrd::le` and friends
It looks like I regressed this accidentally in #137197 due to #137901
So this PR does two things:
1. Tweaks the way we're calling `is_some_and` so that it optimizes in the generic MIR (rather than needing to optimize it in every monomorphization) -- the first commit adds a MIR test, so you can see the difference in the second commit.
2. Updates the implementations of `is_le` and friends to be slightly simpler, and parallel how clang does them.