Skip to content

Rollup of 14 pull requests#153669

Closed
JonathanBrouwer wants to merge 40 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-U0w52X2
Closed

Rollup of 14 pull requests#153669
JonathanBrouwer wants to merge 40 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-U0w52X2

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

ShE3py and others added 30 commits February 7, 2026 17:42
Clang and gcc use this option to control linking behavior too. Some
targets need to be linked against a special crt which enables
profiling at runtime.

This makes using gprof a little easier with Rust binaries. Otherwise,
rustc must be passed `-Clink-args=-pg` to ensure the correct startup
code is linked.
`ActiveJobGuard::complete` and `ActiveJobGuard::drop` have very similar
code, though non-essential structural differences obscure this a little.

This commit factors out the common code into a new method
`ActiveJobGuard::complete_inner`. It also inlines and remove
`expect_job`, which ends up having a single call site.
This commit moves the handling of the trivial "complete" case to the
top of the method. This avoids uselessly constructing a waiter in that
case. It also avoids the need for a separate block scope for `info`.
Use `coerce_to_pin_ref` and `coerce_pin_ref_to_ref` instead.
- `./x run generate-completions`
- Search and replace `--no-doc` with `--all-targets`
  This is to keep the behaviour the same.
- Document `./x test --tests` in `rustc-dev-guide`
- Add change info
Introduces a new check in `rustc_hir_analysis` enforcing that tuples of
scalable vectors should only up to eight vectors.
Renaming to remove any ambiguity as to what "vector" refers to in this
context
Renaming to remove any ambiguity as to what "vector" refers to in this
context.
I haven't worked in these areas for a little while, but happy to still be
pinged if someone wanted.
Synchronize which elements have code paths and which are unreachable betwen def collector and build reduced graph
…ackh726

Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`

This allows the following (mutual) coercions when `T: Unpin`:
- `&T` <-> `Pin<&T>`
- `&mut T` <-> `Pin<&mut T>`
- `&mut T` -> `Pin<&T>`
- `Pin<&mut T>` -> `&T`

Part of [Pin Ergonomics](rust-lang#130494).
Pass -pg to linker when using -Zinstrument-mcount

This selects a slightly different crt on gnu targets which enables the profiler within glibc.

This makes using gprof a little easier with Rust binaries. Otherwise, rustc must be passed `-Clink-args=-pg` to ensure the correct startup code is linked.
…s, r=Mark-Simulacrum,kobzol

Allow `./x test` to run tests without doc tests and without benchmarks

# Problem

For Ferrocene we would like to run only the `coretests` and `alloctests` test suites when measuring code coverage. Running `corebenches` and `allocbenches` would alter the numbers, which is not compliant with the certification.

This is currently not possible in bootstrap. By default `./x test` runs unit, integration and doc tests. `./x test --doc` only runs doc tests. So far, so good.

The problem is that while `./x test --no-doc` stops bootstrap from executing doc tests, it surprisingly starts executing benchmarks (next to examples and bins as well). It basically behaves like `cargo test --all-targets`.

# Solution

This PR renames the existing `--no-doc` flag to `--all-targets` and keeps the same behaviour as before. Unfortunately it is not possible to internally switch from `cargo --bins --examples --tests --benches` to `cargo --all-targets` because it will fail e.g. `./x test library/alloc --all-targets` with an error like "use of unstable library feature `test`".

Additionally, this PR add a `./x test --tests` flag (equivalent to `cargo test --tests`) that only executes unit and integration tests.

Both changes we are doing in https://github.com/ferrocene/ferrocene anyways, but believe that they may be useful for other people as well and therefore would like to contribute them.

Note that this PR does _not_ change the behaviour of either `./x test` or `./x test --doc`.

## Note on `test = true`

While this change enables bootstrap to run tests without doc tests and without benchmarks, executing `./x test library/core library/alloc --tests` will still build and execute `corebenches` and `allocbenches`.

What?! 😱 Why all of this effort to enable it then?

Good question! The reason they are still executed is, that they are marked with `test = true` in their respective `Cargo.toml` ([corebenches](https://github.com/rust-lang/rust/blob/3f9853562c73af38a5e6af8b0da1b2734a327e19/library/coretests/Cargo.toml#L24), [allocbenches](https://github.com/rust-lang/rust/blob/3f9853562c73af38a5e6af8b0da1b2734a327e19/library/alloctests/Cargo.toml#L32)).

@bjorn3 mentioned that it is important for upstream that those benchmarks are executed by default, even if no `./x --all-targets` is passed. This is perfectly possible with this PR. Benchmarks marked with `test = true` will be executed when calling either of `./x test`, `./x test --tests` or `./x --all-targets`. Therefore this PR does not include a commit to change that. We will just do this change in https://github.com/ferrocene/ferrocene.

## Open questions

### Error message

I added one commit that adds an error message if a user passes `--no-doc` and points them to `--all-targets` and `--tests`. I think it might be nice to have, but if you think it is not necessary, I can remove it.

# How to test this change

You can see the change in action by running `./x test library/alloc --tests` and `./x test library/alloc --all-targets`. The first will execute `alloctests` and `allocbenches` (which is marked with `test = true`), while the second will additionally run `benches/vec_deque_append.rs` (which is _not_ marked with `test = true`).
…ochenkov

Refactor `ActiveJobGuard`

A few small improvements.

r? @petrochenkov
@rustbot rustbot added A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 10, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=1000

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 10, 2026

📌 Commit 945bc51 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 10, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153471 (Refactor `ActiveJobGuard`)
 - #153595 (`QueryLatch` cleanups)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153283 (feat(rustdoc-json): Add optional support for rkyv (de)serialization)
 - #153479 (Add rationale for intentional potential_query_instability allows)
 - #153533 (Fix LegacyKeyValueFormat report from docker build: miscellaneous)
 - #153600 (add test for proc-macros with custom panic payloads)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
 - #153659 (Mark an unreachable match arm as such)
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-mingw-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests\run-make\instrument-mcount-link-pg stdout ----

error: rmake recipe failed to complete
status: exit code: 1
command: "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\instrument-mcount-link-pg\\rmake.exe"
stdout: none
--- stderr -------------------------------
command failed at line 12
Command { cmd: "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe" "-L" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\instrument-mcount-link-pg\\rmake_out" "main.rs" "-Zinstrument-mcount" "--print" "link-args" "--target=x86_64-pc-windows-gnu", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe", defused: true, armed_location: Location { file: "D:\\a\\rust\\rust\\tests\\run-make\\instrument-mcount-link-pg\\rmake.rs", line: 12, column: 9 } }, already_executed: true, context: "" }
output status: `exit code: 1`
=== STDOUT ===
"x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\instrument-mcount-link-pg\\rmake_out\\rustcdS3Jl0\\symbols.o" "main.main.d17f5fbe6225cf88-cgu.0.rcgu.o" "main.2uoctswmurc6ir5rvoay0p9ke.rcgu.o" "-Wl,-Bstatic" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-5984157339609bfa.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-a2f57ddcf8fee1c3.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libobject-5043de0836d1ea58.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libmemchr-53a0bfe4e8966a50.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libaddr2line-53f2e6aece29a0e9.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libgimli-fe952aa1db4e700b.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcfg_if-7769f818a78ac789.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libwindows_link-96dc2188b9775621.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-c6f99f6003efc659.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd_detect-077eecf5c6856f3a.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-7ae2e6f0cad22988.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-493643dda4925b3a.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libminiz_oxide-7793000ddb2d18c4.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libadler2-14acbe1f98d465ce.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-c32898e90e87d70e.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-5c6fbe3833f5f61e.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_core-00f3b5c8c97f2745.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-fd1b5092e33dc137.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-0011e1a915080b0f.rlib" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-24edd330b3e93028.rlib" "-Wl,-Bdynamic" "-lkernel32" "-lkernel32" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-ldbghelp" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-lmingwex" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\instrument-mcount-link-pg\\rmake_out" "-o" "main.exe" "-Wl,--gc-sections" "-nodefaultlibs" "-pg"



=== STDERR ===
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\instrument-mcount-link-pg\\rmake_out\\rustcdS3Jl0\\symbols.o" "<2 object files omitted>" "-Wl,-Bstatic" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,libwindows_link-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lkernel32" "-lkernel32" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-ldbghelp" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-lmingwex" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\instrument-mcount-link-pg\\rmake_out" "-o" "main.exe" "-Wl,--gc-sections" "-nodefaultlibs" "-pg"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/lib/../lib/gcrt2.o:gcrt0.c:(.text.startup+0x2b): undefined reference to `monstartup'
          D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/lib/../lib/gcrt2.o:gcrt0.c:(.rdata$.refptr._mcleanup[.refptr._mcleanup]+0x0): undefined reference to `_mcleanup'
          D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: main.main.d17f5fbe6225cf88-cgu.0.rcgu.o:main.d17f5fbe6225cf88-cgu.0:(.text+0x1b): undefined reference to `mcount'
          D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: main.main.d17f5fbe6225cf88-cgu.0.rcgu.o:main.d17f5fbe6225cf88-cgu.0:(.text+0x5f): undefined reference to `mcount'
          D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: main.main.d17f5fbe6225cf88-cgu.0.rcgu.o:main.d17f5fbe6225cf88-cgu.0:(.text+0x8f): undefined reference to `mcount'
          D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: main.main.d17f5fbe6225cf88-cgu.0.rcgu.o:main.d17f5fbe6225cf88-cgu.0:(.text+0xbf): undefined reference to `mcount'
          D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: main.main.d17f5fbe6225cf88-cgu.0.rcgu.o:main.d17f5fbe6225cf88-cgu.0:(.text+0xeb): undefined reference to `mcount'
          D:/a/rust/rust/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: main.main.d17f5fbe6225cf88-cgu.0.rcgu.o:main.d17f5fbe6225cf88-cgu.0:(.text+0x123): more undefined references to `mcount' follow
          collect2.exe: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link

error: aborting due to 1 previous error
------------------------------------------

---- [run-make] tests\run-make\instrument-mcount-link-pg stdout end ----

failures:
    [run-make] tests\run-make\instrument-mcount-link-pg

test result: FAILED. 315 passed; 1 failed; 146 ignored; 0 measured; 5 filtered out; finished in 250.46s

Some tests failed in compiletest suite=run-make mode=run-make host=x86_64-pc-windows-gnu target=x86_64-pc-windows-gnu
Bootstrap failed while executing `test --stage 2 --skip=compiler --skip=src`
Build completed unsuccessfully in 2:39:08
make: *** [Makefile:126: ci-mingw-x] Error 1
  local time: Tue Mar 10 21:39:30 CUT 2026
  network time: Tue, 10 Mar 2026 21:39:30 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 10, 2026

💔 Test for cde84ca failed: CI. Failed job:

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 10, 2026

PR #152457, which is a member of this rollup, was unapproved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.