Skip to content

Rollup of 7 pull requests#157227

Closed
jhpratt wants to merge 19 commits into
rust-lang:mainfrom
jhpratt:rollup-ac898oM
Closed

Rollup of 7 pull requests#157227
jhpratt wants to merge 19 commits into
rust-lang:mainfrom
jhpratt:rollup-ac898oM

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Jun 1, 2026

Successful merges:

r? @ghost

Create a similar rollup

RalfJung and others added 19 commits May 7, 2026 12:29
`compile::Rustc`'s sysroot copying logic intentionally does not
implicitly copy `rustc-dev` artifacts unless explicitly requested
through `builder.ensure(compile::Rustc)`, due to a previous issue
RUST-108767:

```text
// NOTE(rust-lang#108767): We intentionally don't copy `rustc-dev` artifacts until they're
// requested with `builder.ensure(Rustc)`. This fixes an issue where we'd have multiple
// copies of libc in the sysroot with no way to tell which to load. There are a few
// quirks of bootstrap that interact to make this reliable:
// 1. The order `Step`s are run is hard-coded in `builder.rs` and not configurable. This
//    avoids e.g. reordering `test::UiFulldeps` before `test::Ui` and causing the latter
//    to fail because of duplicate metadata.
// 2. The sysroot is deleted and recreated between each invocation, so running `x test
//    ui-fulldeps && x test ui` can't cause failures.
```

So, for rustfmt/clippy, we insert intentionally explicit
`builder.ensure(compile::Rustc)` as a short-term band-aid, leaving
FIXMEs pointing to RUST-156525 to investigate if the multiple libc
copies is still a problem and if that can be fixed properly.

This is by no means a proper fix, but it should unblock local tool
profile workflows trying to use `download-rustc` with {rustfmt,clippy}.
Centrally in `tool::prepare_tool_cargo`.

So that `./x run rustfmt` + `download-rustc` can find the correct rustc
libs.
The `fuzzy_provenance_casts` lint is enabled in most of the standard
library, but its identical twin `lossy_provenance_casts` was not. As
discussed in the tracking issue for those lints, there doesn't seem to
be any good reason to enable one without the other. This PR applies this
principle and as a result removes some unnecessary ptr->int `as` casts.

It's also preparation for merging the two lints, which removes the
option of only enabling `fuzzy_provenance_casts`.
Occasionally we've been having jobs running on systems with limited free
disk space, triggering this script to run. However, it has recently been
failing with the error:

E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/o/openjdk-21/openjdk-21-jre-headless_21.0.10%2b7-1%7e24.04_amd64.deb 404 Not Found [IP: 52.252.163.49 80]
E: Unable to correct problems, you have held broken packages.
E: Aborting install.

This adds an `apt-get update` to try to repair the index before trying
to remove any packages. This seems to work in my testing, but I am far
from an expert on apt.
…domness

`getrandom` is both a crate for this and the name of the underlying
syscall on various OSes. `getentropy` and `arc4random` are common
library calls on various OSes.
A delegation item (`reuse path::method`) has an unresolved HIR
signature: its inputs and return type are `InferDelegation` nodes that
clean to `_`. When the delegated function is async, the `async` header
over that inferred return type made `clean_fn_decl_with_params` call
`sugared_async_return_type` on a non-`impl Future` type, panicking with
"unexpected async fn return type".

Clean the resolved ty-side signature for delegation items instead, the
same way inlined items are cleaned. This avoids the ICE and renders the
real return type and `self` parameter rather than `-> _` / `self: _`.
…hlin

miri: require (almost) all 1-ZST arguments to be actually passed

We can't ignore *all* of them since the compiler itself relies on non-capturing closure arguments being ignored.

Fixes rust-lang/miri#4993

Cc @folkertdev since it also changes the checks for variadics.
…venance-lints, r=jhpratt

library: use strict provenance lints consistently

The `fuzzy_provenance_casts` lint is enabled in most of the standard library, but its identical twin `lossy_provenance_casts` was not. As discussed in the tracking issue for those lints, there doesn't seem to be any good reason to enable one without the other. This PR applies this principle and as a result removes some unnecessary ptr->int `as` casts.

It's also preparation for merging the two lints, which removes the option of only enabling `fuzzy_provenance_casts`.

Tracking issue: rust-lang#130351
…on-157040-b, r=GuillaumeGomez

rustdoc: Fix ICE on delegated async functions

Fixes rust-lang#157040

rustdoc ICEs with "unexpected async fn return type" on an async delegation like `reuse Trait::foo`. The delegation's HIR signature isn't resolved yet, so its return type cleans to `_`, but the header is still `async`, and sugaring an inferred return type panics.

For delegation items we now clean the resolved signature from the ty side, the same way inlined items already do, instead of the HIR one. That sidesteps the panic and also renders the real return type and `self` parameter instead of `-> _` and `self: _`. The `<Self>` generic that shows up on the free-function form is pre-existing (plain sync delegation prints it too) and left alone.
…load-rustc, r=Mark-Simulacrum

Explicitly request copying `rustc-dev` artifacts for rustfmt/clippy and add rustc libs path for rustc-private tools under `download-rustc`

## Summary

[#t-infra/bootstrap > x run rustfmt works but x test rustfmt fails to compile](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/x.20run.20rustfmt.20works.20but.20x.20test.20rustfmt.20fails.20to.20compile/with/594752284) reported that `./x test rustfmt --stage={1,2}` no longer works with `download-rustc`.

* This seems to be due to us removing some manual `builder.ensure(Rustc)`s around the times of stage 0 rejiggling.
* Because `compile::Sysroot::run` has a quirky non-trivial behavior regarding `rustc-dev` artifact copying under `download-rustc`, tracing back to sysroot dep resolution troubles (cf. rust-lang#108767), we need to explicitly `ensure(Rustc)` to opt-in to `rustc-dev` artifact copying under `download-rustc`.
* For the short-term, let's insert manual `ensure`s to force `rustc-dev` artifact copying under `download-rustc` to unblock rustfmt/clippy contributors who want to use `download-rustc` (to avoid having to build the compiler).

Additionally, I needed to explicitly add rustc libs path for `RustcPrivate` tools, or else it seems like the ci-rustc sysroot is not always correctly set.

## Testing

Use a dummy config: `bootstrap.rustfmt.toml`

```toml
profile = "tools"
change-id = "ignore"

[rust]
# Force download-rustc, needed because we modify bootstrap which makes
# `if-unchanged` ineligible.
download-rustc = true
```

Run:

* `./x test rustfmt --config=bootstrap.rustfmt.toml --stage=1`
* `./x test rustfmt --config=bootstrap.rustfmt.toml --stage=2`
* `./x test clippy --config=bootstrap.rustfmt.toml --stage=1`
* `./x test clippy --config=bootstrap.rustfmt.toml --stage=2`

When reviewing, also check that if you revert the commit / this PR, that invocations above fail (which is the case against `main` for me).

Tested also without `download-rustc` to make sure `./x test {rustfmt,clippy} --stage={1,2}` still works.

## Notes

This is by no means a proper fix, but it should unblock local tool profile workflows trying to use `download-rustc` with {rustfmt,clippy}. I don't think it's worth blocking over that.

Efforts for a more proper fix should be tracked by rust-lang#156525, I left FIXMEs pointing to that.
…, r=workingjubilee

update TargetFeature::Forbidden docs

That comment was a bit outdated, I think I wrote it before `abi_required_features` existed.

r? @workingjubilee
Cc @wesleywiser
…Simulacrum

Fix CI free-disk-space-linux script

Occasionally we've been having jobs running on systems with limited free disk space, triggering this script to run. However, it has recently been failing with the error:

E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/o/openjdk-21/openjdk-21-jre-headless_21.0.10%2b7-1%7e24.04_amd64.deb 404 Not Found [IP: 52.252.163.49 80]
E: Unable to correct problems, you have held broken packages.
E: Aborting install.

This adds an `apt-get update` to try to repair the index before trying to remove any packages. This seems to work in my testing, but I am far from an expert on apt.
…as, r=jhpratt

Help people looking for random bytes find `DefaultRandomSource.fill_bytes`

Mention, in the `DefaultRandomSource` docs, how to fill a buffer with random bytes.

Add doc aliases for `DefaultRandomSource`, for people looking for various sources of randomness.

`getrandom` is both a crate for this and the name of the underlying syscall on various OSes. `getentropy` and `arc4random` are common library calls on various OSes.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 1, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc O-SGX Target: SGX O-unix Operating system: Unix-like 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 Jun 1, 2026
@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Jun 1, 2026
@jhpratt jhpratt closed this Jun 1, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2026
@jhpratt jhpratt deleted the rollup-ac898oM branch June 1, 2026 02:29
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
tests/fail/tree_borrows/wildcard/subtree_internal_relatedness.rs ... ok
tests/fail/tree_borrows/wildcard/subtree_internal_relatedness_wildcard.rs ... ok

FAILED TEST: tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tQ2Vzp" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/fail/function_pointers" "tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs" "--edition" "2021"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/function_pointers/abi_mismatch_closure_non_capturing.stderr` to the actual output
--- tests/fail/function_pointers/abi_mismatch_closure_non_capturing.stderr
+++ <stderr output>
 error: Undefined Behavior: calling a function whose parameter #1 has type {closure@tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:LL:CC} passing argument of type Zst
   --> tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:LL:CC
... 13 lines skipped ...
            0: main::{closure#0}
                at tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:LL:CC
-           1: foo
+           1: foo::<{closure@tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:LL:CC}>
                at tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:LL:CC
            2: main
... 4 lines skipped ...
 error: aborting due to 1 previous error
 

Full unnormalized output:
error: Undefined Behavior: calling a function whose parameter #1 has type {closure@tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9: 15:16} passing argument of type Zst
##[error]  --> tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9
   |
LL |       foo(move || {
   |  _________^
LL | |
LL | |         println!("non-capturing closure");
LL | |     });
   | |_____^ Undefined Behavior occurred here
   |
   = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
   = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
   = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
   = help: if you think this code should be accepted anyway, please report an issue with Miri
   = note: stack backtrace:
           0: main::{closure#0}
               at tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9: 18:6
           1: foo::<{closure@tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9: 15:16}>
               at tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:11:5: 11:11
---



full stderr:
error: Undefined Behavior: calling a function whose parameter #1 has type {closure@tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9: 15:16} passing argument of type Zst
##[error]  --> tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9
   |
LL |       foo(move || {
   |  _________^
LL | |
LL | |         println!("non-capturing closure");
LL | |     });
   | |_____^ Undefined Behavior occurred here
   |
   = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
   = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
   = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
   = help: if you think this code should be accepted anyway, please report an issue with Miri
   = note: stack backtrace:
           0: main::{closure#0}
               at tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9: 18:6
           1: foo::<{closure@tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:15:9: 15:16}>
               at tests/fail/function_pointers/abi_mismatch_closure_non_capturing.rs:11:5: 11:11
---



FAILED TEST: tests/fail/validity/fn_arg_never_type.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-tQ2Vzp" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/fail/validity" "tests/fail/validity/fn_arg_never_type.rs" "--edition" "2021"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/validity/fn_arg_never_type.stderr` to the actual output
--- tests/fail/validity/fn_arg_never_type.stderr
+++ <stderr output>
---
Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.5/src/lib.rs:365

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: <color_eyre[4fb328a1b3c618b6]::config::EyreHook>::into_eyre_hook::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   2: eyre[15a0a73335eb68a4]::capture_handler<unknown>
      at <unknown source file>:<unknown line>
   3: eyre[15a0a73335eb68a4]::private::format_err<unknown>
      at <unknown source file>:<unknown line>
   4: ui_test[4f1024b8a9a19858]::run_tests_generic::<ui_test[4f1024b8a9a19858]::default_file_filter, ui[2e13d048f9407200]::run_tests::{closure#1}, alloc[a314c365654779c5]::boxed::Box<dyn ui_test[4f1024b8a9a19858]::status_emitter::StatusEmitter>><unknown>
      at <unknown source file>:<unknown line>
   5: ui[2e13d048f9407200]::ui<unknown>
      at <unknown source file>:<unknown line>
   6: ui[2e13d048f9407200]::main<unknown>
      at <unknown source file>:<unknown line>
   7: std[fa8609b19cb0285f]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[8e5c1f70433aec58]::result::Result<(), eyre[15a0a73335eb68a4]::Report>, core[8e5c1f70433aec58]::result::Result<(), eyre[15a0a73335eb68a4]::Report>><unknown>
      at <unknown source file>:<unknown line>
   8: std[fa8609b19cb0285f]::rt::lang_start::<core[8e5c1f70433aec58]::result::Result<(), eyre[15a0a73335eb68a4]::Report>>::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   9: std[fa8609b19cb0285f]::rt::lang_start_internal<unknown>
      at <unknown source file>:<unknown line>
  10: main<unknown>
      at <unknown source file>:<unknown line>
  11: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  12: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/ui-8ca6a91a668da589` (exit status: 1)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color=always --profile=release --manifest-path /checkout/src/tools/miri/Cargo.toml -- [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:191:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:745:19

--- BACKTRACE vvv
   0: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at /checkout/src/bootstrap/src/utils/exec.rs:939:17
   1: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at /checkout/src/bootstrap/src/utils/exec.rs:831:21
   2: <bootstrap::utils::exec::ExecutionContext>::run
             at /checkout/src/bootstrap/src/utils/exec.rs:741:45
   3: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at /checkout/src/bootstrap/src/utils/exec.rs:339:27
   4: <bootstrap::core::build_steps::test::Miri as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:745:19
   5: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Miri>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1595:36
   6: <bootstrap::core::build_steps::test::Miri as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:671:21
   7: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:476:13
   8: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:232:18
   9: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1138:9
  10: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1117:14
  11: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:803:25
  12: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:130:11
  13: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:250:5
  14: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/sys/backtrace.rs:166:18
  15: std::rt::lang_start::<()>::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:206:18
  16: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:287:21
  17: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
  18: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:544:19
  19: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panic.rs:359:14
  20: std::rt::lang_start_internal::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:175:24
  21: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
---
  28: __libc_start_main
  29: _start


Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test --stage 2 src/tools/miri src/tools/miri/cargo-miri`
Build completed unsuccessfully in 0:49:34
  local time: Mon Jun  1 03:22:49 UTC 2026
  network time: Mon, 01 Jun 2026 03:22:49 GMT
##[error]Process completed with exit code 1.

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-testsuite Area: The testsuite used to check the correctness of rustc O-SGX Target: SGX O-unix Operating system: Unix-like 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants