Skip to content

Rollup of 12 pull requests #142574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Jun 16, 2025
Merged

Rollup of 12 pull requests #142574

merged 36 commits into from
Jun 16, 2025

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Jun 16, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

m-ou-se and others added 30 commits June 11, 2025 18:28
It wasn't really needed there.
It would not be correct if multiple values of `target_dir` were ever passed to the function in the same process.
They were using `--config` instead of `--set`, which overrides too much stuff.
Expose discriminant values in stable_mir

Resolves rust-lang/project-stable-mir#93
* Added `Discr` struct to stable mir as stable version of struct with same name
* Added `discriminant_for_variant`  method to `AdtDef` and `CoroutineDef`
…s, r=jdonszelmann

Refactor `rustc_attr_data_structures` documentation

I was reading through `AttributeKind` and realized that attributes like `InlineAttr` didn't appear in it, however, I found them in `rustc_codegen_ssa` and understood why (guessing).

There's almost no overall documentation for this crate, I've added the organized documentation at the top of `lib.rs`, and I've grouped the Attributes into two categories: `AttributeKind` that run all through the compiler, and the ones that are only used in `codegen_ssa`, such as `InlineAttr`, `OptimizeAttr`, `InstructionSetAttr`.

Also, I've added documentation for `AttributeKind` that further explains why attributes like `InlineAttr` don't appear in it, with examples for each variant.

r? ```@jdonszelmann```
…enton

Stabilize "file_lock" feature

Closes rust-lang#130994

r? ```@joshtriplett```
…cs, r=tgross35

Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls

I think it's not very obvious that `PathBuf`'s `Extend` and `FromIterator` impls work like `PathBuf::push`, so I think these should be documented.
I'm not very happy with the wording and examples, open to suggestions :)
…ouxu

Assorted bootstrap cleanups (step 2)

Very small improvements designed towards making bootstrap tests less hacky/special, and towards making it possible to run bootstrap tests in parallel.

Best reviewed commit by commit.

r? ``@jieyouxu``
Kobzol added 6 commits June 16, 2025 14:31
…=jieyouxu

Add initial version of snapshot tests to bootstrap

When making any changes to bootstrap (steps), it is very difficult to realize how does it affect various common bootstrap commands, and if everything still works as we expect it to. We are far away from having actual end-to-end tests, but what we could at least do is have a way of testing what steps does bootstrap execute in dry run mode. Now, we already have something like this in `src/bootstrap/src/core/builder/tests.rs`, however that is quite limited, because it only checks executed steps for a specific impl of `Step` and it does not consider step order.

Recently, when working on what I thought was one of the simplest possible step untanglings in bootstrap (rust-lang#142357), I ran into errors in tests that were quite hard to debug. Partly also because the current staging test diffs are multiline and use `Debug` output, so it's quite difficult for me to make sense of them.

In this PR, I introduce `insta`, which allows writing snapshot tests in a very simple way. With it, I want to allow writing tests that will clearly show us what is going on during bootstrap execution, and then write golden tests for `build/check/test` stage `0/1/2` for compiler/std/tools etc., to make sure that we don't regress something, and also to help with [#t-infra/bootstrap > Proposal to cleanup stages and steps after the redesign](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Proposal.20to.20cleanup.20stages.20and.20steps.20after.20the.20redesign/with/523488806), to help avoid a situation where we would (again) have to make a flurry of staging changes because of unexpected consequences.

In the snapshot tests, we currently render the build of rustc, std and LLVM. Currently I render the executed steps using downcasting, which is not super pretty, but it allows us to make the test rendering localized in one place, and it's IMO enough for now.

I implemented only a single test using the new machinery. Maybe if you take a look at it, you will understand why 😆 Bootstrap currently does some peculiar things, such as running a stage 0 std step (even though stage 0 std no longer exists) and running the Rustc stage 0 -> 1 step twice, once with a single crates, once with all rustc crates. So I think that even with this single step, there will be a bunch of things to fix in the near future...

The way we currently prepare the Config test fixtures is far from ideal, this is something I think ``@Shourya742`` could work on as a part of their GSoC project (remove as much command execution from Config construction as possible, actually run bootstrap on a temporary directory instead of running it on the rustc checkout, create a Builder-like API for creating the Config test fixtures).

r? ``@jieyouxu``
…wLii

Add documentation on top of `rustc_middle/src/query/mod.rs`

The `rustc-dev-guide` gives a high-level intro, but many details—especially about how the code works and modifiers in `query xxx(){...}`—are only in code comments or the macro implementation. This doc makes it easier for contributors and code readers to understand the workflow and available modifiers without jumping between files and docs.

This PR adds a comprehensive module-level doc comment to `rustc_middle::query::mod.rs` that:
1. Provides an overview of the query system and macro-based query definitions for reading code more easily
2. Centralizes documentation for all query modifiers (previously scattered or only in `rustc_macro` code), closely following the authoritative list in QueryModifiers.
…v, r=RalfJung

clarify `rustc_do_not_const_check` comment

~~Given that we have used this attribute for other reasons before it seems appropriate to make this a "usually".~~

Add function name as a pointer

cc ```@rust-lang/wg-const-eval```
…q, r=compiler-errors

use `if let` guards where possible

these crates already enable the feature
…nyukang

Remove an `njn:` comment accidentaly left behind.

r? `@chenyukang`
Fix `-nopt` CI jobs

They were using `--config` instead of `--set`, which overrides too much stuff after recent changes to config merging.

Should hopefully unblock rust-lang#142447.

r? `@jieyouxu`
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. rollup A PR which is a rollup labels Jun 16, 2025
@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 16, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 16, 2025

📌 Commit 78d12b7 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors 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 16, 2025
@bors
Copy link
Collaborator

bors commented Jun 16, 2025

⌛ Testing commit 78d12b7 with merge 3bc767e...

@bors
Copy link
Collaborator

bors commented Jun 16, 2025

☀️ Test successful - checks-actions
Approved by: Kobzol
Pushing 3bc767e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 16, 2025
@bors bors merged commit 3bc767e into rust-lang:master Jun 16, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 16, 2025
Copy link
Contributor

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 d9ca9bd (parent) -> 3bc767e (this PR)

Test differences

Show 2639 test diffs

Stage 1

  • args_debug: [missing] -> pass (J0)
  • backtrace::tests::test_debug: [missing] -> pass (J0)
  • collections::hash::map::tests::const_with_hasher: [missing] -> pass (J0)
  • collections::hash::map::tests::test_from_iter: [missing] -> pass (J0)
  • collections::hash::map::tests::test_iter_mut_len: [missing] -> pass (J0)
  • collections::hash::map::tests::test_iterate: [missing] -> pass (J0)
  • collections::hash::map::tests::test_values: [missing] -> pass (J0)
  • collections::hash::set::tests::test_iterate: [missing] -> pass (J0)
  • eq_multidispatch: [missing] -> pass (J0)
  • f16::test_asinh: [missing] -> pass (J0)
  • f16::test_ln_gamma: [missing] -> pass (J0)
  • f16::test_real_consts: [missing] -> pass (J0)
  • f32::test_exp: [missing] -> pass (J0)
  • f64::test_acosh: [missing] -> pass (J0)
  • f64::test_log: [missing] -> pass (J0)
  • ffi::os_str::tests::boxed_default: [missing] -> pass (J0)
  • ffi::os_str::tests::clone_to_uninit: [missing] -> pass (J0)
  • ffi::os_str::tests::into_boxed: [missing] -> pass (J0)
  • ffi::os_str::tests::test_os_string_clear: [missing] -> pass (J0)
  • ffi::os_str::tests::test_os_string_leak: [missing] -> pass (J0)
  • fs::tests::copy_file_does_not_exist: [missing] -> pass (J0)
  • fs::tests::copy_file_follows_dst_symlink: [missing] -> pass (J0)
  • fs::tests::dir_entry_methods: [missing] -> pass (J0)
  • fs::tests::file_lock_dup: [missing] -> pass (J0)
  • fs::tests::file_test_io_seek_and_tell_smoke_test: [missing] -> pass (J0)
  • fs::tests::file_test_io_smoke_test: [missing] -> pass (J0)
  • fs::tests::realpath_works: [missing] -> pass (J0)
  • fs::tests::recursive_mkdir_slash: [missing] -> pass (J0)
  • fs::tests::symlink_hard_link: [missing] -> pass (J0)
  • fs::tests::sync_doesnt_kill_anything: [missing] -> pass (J0)
  • io::buffered::tests::bench_buffered_writer: [missing] -> pass (J0)
  • io::buffered::tests::bufwriter_aliasing: [missing] -> pass (J0)
  • io::buffered::tests::test_buffered_reader_invalidated_after_seek: [missing] -> pass (J0)
  • io::cursor::tests::test_array_writer: [missing] -> pass (J0)
  • io::cursor::tests::test_mem_reader: [missing] -> pass (J0)
  • io::tests::read_buf_data_and_error_buf: [missing] -> pass (J0)
  • io::tests::read_to_string: [missing] -> pass (J0)
  • io::tests::take_eof: [missing] -> pass (J0)
  • lazy_lock::sync_lazy_new: [missing] -> pass (J0)
  • mpmc::oneshot_multi_thread_send_close_stress: [missing] -> pass (J0)
  • mpmc::oneshot_single_thread_close_chan_first: [missing] -> pass (J0)
  • mpmc::oneshot_single_thread_try_send_closed: [missing] -> pass (J0)
  • mpmc::oneshot_single_thread_try_send_open: [missing] -> pass (J0)
  • mpmc::smoke: [missing] -> pass (J0)
  • mpmc::smoke_chan_gone_shared: [missing] -> pass (J0)
  • mpmc::smoke_receiver_clone: [missing] -> pass (J0)
  • mpmc::smoke_shared: [missing] -> pass (J0)
  • mpmc::smoke_shared_port_gone: [missing] -> pass (J0)
  • mpmc::test_recv_into_iter_borrowed: [missing] -> pass (J0)
  • mpsc::no_runtime: [missing] -> pass (J0)
  • mpsc::oneshot_single_thread_send_port_close: [missing] -> pass (J0)
  • mpsc::stream_send_recv_stress: [missing] -> pass (J0)
  • mpsc::test_recv_iter_break: [missing] -> pass (J0)
  • mpsc_sync::oneshot_multi_task_recv_then_close: [missing] -> pass (J0)
  • mpsc_sync::port_gone_concurrent: [missing] -> pass (J0)
  • mpsc_sync::send_timeout: [missing] -> pass (J0)
  • mutex::lots_and_lots: [missing] -> pass (J0)
  • mutex::smoke: [missing] -> pass (J0)
  • mutex::test_mapping_mapped_guard: [missing] -> pass (J0)
  • net::socket_addr::tests::is_v6: [missing] -> pass (J0)
  • net::socket_addr::tests::socket_v4_to_str: [missing] -> pass (J0)
  • net::tcp::tests::clone_while_reading: [missing] -> pass (J0)
  • net::tcp::tests::nodelay: [missing] -> pass (J0)
  • net::tcp::tests::tcp_clone_two_read: [missing] -> pass (J0)
  • net::tcp::tests::ttl: [missing] -> pass (J0)
  • once::wait: [missing] -> pass (J0)
  • os::unix::net::tests::test_unix_stream_peek: [missing] -> pass (J0)
  • path::bench_hash_path_long: [missing] -> pass (J0)
  • process::tests::test_interior_nul_in_arg_is_error: [missing] -> pass (J0)
  • process::tests::test_interior_nul_in_current_dir_is_error: [missing] -> pass (J0)
  • reentrant_lock::trylock_works: [missing] -> pass (J0)
  • rwlock::test_get_mut: [missing] -> pass (J0)
  • rwlock::test_set_poison: [missing] -> pass (J0)
  • sys::fd::unix::tests::limit_vector_count: [missing] -> pass (J0)
  • sys::fs::unix::tests::test_debug_permissions: [missing] -> pass (J0)
  • sys::net::connection::socket::tests::no_lookup_host_duplicates: [missing] -> pass (J0)
  • sys::pal::unix::kernel_copy::tests::copies_append_mode_sink: [missing] -> pass (J0)
  • sys::personality::dwarf::tests::dwarf_reader: [missing] -> pass (J0)
  • sys_common::tests::test_muldiv: [missing] -> pass (J0)
  • sys_common::wtf8::tests::code_point_from_u32: [missing] -> pass (J0)
  • sys_common::wtf8::tests::code_point_to_string: [missing] -> pass (J0)
  • sys_common::wtf8::tests::wtf8_to_ascii_uppercase: [missing] -> pass (J0)
  • sys_common::wtf8::tests::wtf8_utf8_boundary_between_surrogates: [missing] -> pass (J0)
  • sys_common::wtf8::tests::wtf8buf_show_str: [missing] -> pass (J0)
  • test_clone_into: [missing] -> pass (J0)
  • test_compare: [missing] -> pass (J0)
  • test_heap_log: [missing] -> pass (J0)
  • test_prefix_ext: [missing] -> pass (J0)
  • test_self_exe_path: [missing] -> pass (J0)
  • test_with_extension: [missing] -> pass (J0)
  • tests::smoke_no_dtor: [missing] -> pass (J0)
  • tests::thread_current_in_dtor: [missing] -> pass (J0)
  • thread::tests::test_is_finished: [missing] -> pass (J0)
  • thread::tests::test_park_timeout_unpark_called_other_thread: [missing] -> pass (J0)
  • thread::tests::test_park_unpark_called_other_thread: [missing] -> pass (J0)
  • thread::tests::test_scoped_threads_drop_result_before_join: [missing] -> pass (J0)
  • thread::tests::test_simple_newsched_spawn: [missing] -> pass (J0)
  • thread::tests::test_thread_id_equal: [missing] -> pass (J0)
  • thread::tests::test_thread_id_not_equal: [missing] -> pass (J0)
  • thread_local_containing_const_statements: [missing] -> pass (J0)

(and 965 additional test diffs)

Additionally, 1574 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 3bc767e1a215c4bf8f099b32e84edb85780591b1 --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. i686-gnu-nopt-2: 5379.7s -> 8020.5s (49.1%)
  2. x86_64-apple-1: 6780.9s -> 9137.0s (34.7%)
  3. mingw-check-1: 1610.2s -> 1959.7s (21.7%)
  4. x86_64-gnu-nopt: 6185.9s -> 7371.8s (19.2%)
  5. x86_64-gnu-llvm-20-1: 3163.7s -> 3675.7s (16.2%)
  6. dist-aarch64-apple: 6379.0s -> 7398.0s (16.0%)
  7. i686-gnu-2: 5255.3s -> 6084.0s (15.8%)
  8. dist-apple-various: 7718.2s -> 8854.6s (14.7%)
  9. aarch64-gnu-debug: 3609.5s -> 4113.2s (14.0%)
  10. x86_64-rust-for-linux: 2565.2s -> 2919.6s (13.8%)
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
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#141639 Expose discriminant values in stable_mir 4e710862ecd661989d875a624c431e4f6941d089 (link)
#142082 Refactor rustc_attr_data_structures documentation 20c24c3a906626ab65e715651e3a762e591b5253 (link)
#142125 Stabilize "file_lock" feature 3b755d2b8403af5d9cc133a8c87dd3c7b5baacb5 (link)
#142236 Add documentation for PathBuf's FromIterator and `Exten… 21a3d14e77a2a666fc935d4e4430d9ecf396af41 (link)
#142373 Fix Debug for Location 72e126fc565642d9630a5632f7ce6cc88e6c1bf6 (link)
#142416 Assorted bootstrap cleanups (step 2) 6aefd35ca48eb84ad7571378b923a4cd7a64918a (link)
#142431 Add initial version of snapshot tests to bootstrap d6a465bd774fd9f9a238d340974fbbd21ec2454d (link)
#142450 Add documentation on top of rustc_middle/src/query/mod.rs a6ff53fb98c001d962002a5afa0a08ef1fc7034f (link)
#142528 clarify rustc_do_not_const_check comment 88349840065b69e0b0d921b9ffc5280e56824eff (link)
#142530 use if let guards where possible a800ac00f0972f9a35c75faa4b6c8885873da203 (link)
#142561 Remove an njn: comment accidentaly left behind. 85c131b26c5fbcfdd895eea7a24daf41ac189015 (link)
#142566 Fix -nopt CI jobs 21ac3baae0ef4d53b31860c6fd9df5d8d2090ebf (link)

previous master: d9ca9bd014

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

@Kobzol Kobzol deleted the rollup-ldj386u branch June 16, 2025 17:52
compiler-errors pushed a commit to compiler-errors/rust that referenced this pull request Jun 16, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#141639 (Expose discriminant values in stable_mir)
 - rust-lang#142082 (Refactor `rustc_attr_data_structures` documentation)
 - rust-lang#142125 (Stabilize "file_lock" feature)
 - rust-lang#142236 (Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls)
 - rust-lang#142373 (Fix Debug for Location)
 - rust-lang#142416 (Assorted bootstrap cleanups (step 2))
 - rust-lang#142431 (Add initial version of snapshot tests to bootstrap)
 - rust-lang#142450 (Add documentation on top of `rustc_middle/src/query/mod.rs`)
 - rust-lang#142528 (clarify `rustc_do_not_const_check` comment)
 - rust-lang#142530 (use `if let` guards where possible)
 - rust-lang#142561 (Remove an `njn:` comment accidentaly left behind.)
 - rust-lang#142566 (Fix `-nopt` CI jobs)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3bc767e): 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.9% [0.9%, 0.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -7.3%, secondary 10.0%)

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

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

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 756.489s -> 757.216s (0.10%)
Artifact size: 372.07 MiB -> 372.11 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.