Skip to content

Rollup of 6 pull requests#157228

Merged
rust-bors[bot] merged 17 commits into
rust-lang:mainfrom
jhpratt:rollup-V1fPjTM
Jun 1, 2026
Merged

Rollup of 6 pull requests#157228
rust-bors[bot] merged 17 commits into
rust-lang:mainfrom
jhpratt:rollup-V1fPjTM

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Jun 1, 2026

Successful merges:

r? @ghost

Create a similar rollup

jieyouxu and others added 17 commits May 24, 2026 14:25
`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: _`.
…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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jun 1, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Jun 1, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 1, 2026

📌 Commit e5b9884 has been approved by jhpratt

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 Jun 1, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 1, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 1, 2026

☀️ Test successful - CI
Approved by: jhpratt
Duration: 3h 25m 56s
Pushing 4530eac to main...

@rust-bors rust-bors Bot merged commit 4530eac into rust-lang:main Jun 1, 2026
13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 1, 2026
@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#156528 Explicitly request copying rustc-dev artifacts for rustfm… 803ddfed3153d5398bfad946baa45f382f879dd6 (link)
#156832 library: use strict provenance lints consistently 9543c0c3442d6eea78074eb6a84bb5d39391f953 (link)
#157059 update TargetFeature::Forbidden docs 8ea63b397f3e83c564cb1e8866d53d4f2751e016 (link)
#157159 Fix CI free-disk-space-linux script 3e3b978c8cb043b46c765be000c7c1d3dacc432d (link)
#157221 Help people looking for random bytes find `DefaultRandomSou… fa78de0622ca34804f517b563282d7eb855f5aa9 (link)
#157223 rustdoc: Fix ICE on delegated async functions 9cda546870f5a623a82007b83f8a0c4c7bb546cf (link)

previous master: bef8e620f1

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing bef8e62 (parent) -> 4530eac (this PR)

Test differences

Show 239 test diffs

Stage 1

  • [rustdoc-html] tests/rustdoc-html/async/async-fn-delegation.rs: [missing] -> pass (J1)

Stage 2

  • [run-make] tests/run-make/compressed-debuginfo-zstd: ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) -> pass (J0)
  • [rustdoc-html] tests/rustdoc-html/async/async-fn-delegation.rs: [missing] -> pass (J2)

Additionally, 236 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 4530eac197dfc6975c23d5d01e85e44bf7f18d69 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-gcc-core-tests: 1h 8m -> 14m 41s (-78.5%)
  2. dist-aarch64-apple: 4h 58m -> 1h 42m (-65.7%)
  3. pr-check-1: 1h 26m -> 33m 32s (-61.1%)
  4. pr-check-2: 1h 34m -> 43m 1s (-54.7%)
  5. x86_64-gnu-gcc: 2h 11m -> 1h 9m (-47.3%)
  6. x86_64-gnu-miri: 2h 54m -> 1h 33m (-46.6%)
  7. x86_64-rust-for-linux: 1h 41m -> 55m 1s (-45.9%)
  8. test-various: 3h 5m -> 1h 42m (-45.1%)
  9. x86_64-gnu-tools: 2h 1m -> 1h 6m (-45.0%)
  10. arm-android: 2h 59m -> 1h 45m (-41.5%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4530eac): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.5% [0.2%, 0.6%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 6.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
6.5% [6.5%, 6.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 6.5% [6.5%, 6.5%] 1

Cycles

Results (primary 3.3%, secondary 4.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.3% [3.3%, 3.3%] 1
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.3% [3.3%, 3.3%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 518.865s -> 510.437s (-1.62%)
Artifact size: 400.72 MiB -> 400.71 MiB (-0.00%)

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 merged-by-bors This PR was explicitly merged by bors. 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