Skip to content

Rollup of 8 pull requests #142814

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 27 commits into from
Jun 21, 2025
Merged

Rollup of 8 pull requests #142814

merged 27 commits into from
Jun 21, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jun 21, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

celinval and others added 27 commits June 11, 2025 10:43
This commit literally copied the directory rayon-core from
revision `5fadf44`. Link:
https://github.com/rust-lang/rustc-rayon/tree/5fadf44/rayon-core
Currently all of its call sites construct a `LifetimeRibKind::Generics`
value, which `with_generic_param_rib` then deconstructs (and panics if
it's a different `LifetimeRibKind` variant).

This commit makes the code simpler and shorter: the call sites just pass
in the three values and `with_generic_param_rib` constructs the
`LifetimeRibKind::Generics` value from them.
Only emit git errors if we are in CI environment
This test currently fails (as expected).

    --- stderr -------------------------------
    Pretty-printer lost necessary parentheses
      BEFORE: #[attr] (1 + 1)
       AFTER: #[attr] 1 + 1

    Pretty-printer lost necessary parentheses
      BEFORE: #[attr] (1 as T)
       AFTER: #[attr] 1 as T

    Pretty-printer lost necessary parentheses
      BEFORE: #[attr] (x = 1)
       AFTER: #[attr] x = 1

    Pretty-printer lost necessary parentheses
      BEFORE: #[attr] (x += 1)
       AFTER: #[attr] x += 1
    ------------------------------------------
Bringing `rustc_rayon_core` in tree as `rustc_thread_pool`

This PR moves [`rustc_rayon_core`](https://github.com/rust-lang/rustc-rayon/tree/5fadf44/rayon-core) from commit `5fadf44` as suggested in [this zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Bringing.20.60rustc_rayon_core.60.20in.20tree). I tried to split the work into separate commits so it is easy to review. The first commit is a simple copy and paste from the fork, and subsequent changes were made to use the new crate and to ensure the new crate complies with different format and lint expectations.

**Call-out:** I was also wondering if I need to make any further changes to accommodate licensing requirements.

r? oli-obk
Insert parentheses around binary operation with attribute

Fixes the bug found by `@fmease` in rust-lang#134661 (review).

Previously, `-Zunpretty=expanded` would expand this program as follows:

```rust
#![feature(stmt_expr_attributes)]
#![allow(unused_attributes)]

macro_rules! group {
    ($e:expr) => {
        $e
    };
}

macro_rules! extra {
    ($e:expr) => {
        #[allow()] $e
    };
}

fn main() {
    let _ = #[allow()] 1 + 1;
    let _ = group!(#[allow()] 1) + 1;
    let _ = 1 + group!(#[allow()] 1);
    let _ = extra!({ 0 }) + 1;
    let _ = extra!({ 0 } + 1);
}
```

```console
let _ = #[allow()] 1 + 1;
let _ = #[allow()] 1 + 1;
let _ = 1 + #[allow()] 1;
let _ = #[allow()] { 0 } + 1;
let _ = #[allow()] { 0 } + 1;
```

The first 4 statements are the correct expansion, but the last one is not. The attribute is supposed to apply to the entire binary operation, not only to the left operand.

After this PR, the 5th statement will expand to:

```console
let _ = #[allow()] ({ 0 } + 1);
```

In the future, as some subset of `stmt_expr_attributes` approaches stabilization, it is possible that we will need to do parenthesization for a number of additional cases depending on the outcome of rust-lang#127436. But for now, at least this PR makes the pretty-printer align with the current behavior of the parser.

r? fmease
…tern, r=petrochenkov

Marks ADT live if it appears in pattern

Marks ADT live if it appears in pattern, it implies the construction of the ADT.
1. Then we can detect unused private ADTs impl `Default`, without special logics for `Default` and other std traits.
2. We can also remove `rustc_trivial_field_reads` on `Default`, and the logic in `should_ignore_item` (introduced by rust-lang#126302).

Fixes rust-lang#120770

Extracted from rust-lang#128637.
r? `@petrochenkov`
Reason about borrowed classes in CopyProp.

Fixes rust-lang#141122

The current implementation of `CopyProp` avoids unifying two borrowed locals, as this would change the result of address comparison.

However, the implementation was inconsistent with the general algorithm, which identifies equivalence classes of locals and then replaces all locals by a single representative of their equivalence class.

This PR fixes it by forbidding the unification of two *classes* if any of those contain a borrowed local.
…n-update, r=Kobzol

Add CI check to ensure that rustdoc JSON `FORMAT_VERSION` is correctly updated

Follow-up of rust-lang#142601.

Tested it locally with: `BASE_COMMIT=1bb335244c311a07cee165c28c553c869e6f64a9 src/ci/docker/host-x86_64/mingw-check-1/validate-rustdoc-json-format-version-update.sh` (where `BASE_COMMIT` value was the commit before I made a wrong change with the `FORMAT_VERSION` update).

This is a first version. I plan to send a follow-up to also ensure that `FORMAT_VERSION` is updated if any code change is done in `rustdoc-json-types`. For that I just need to check that a line not starting with `/` and not an empty line was updated. Fun times with `grep` ahead. :')

cc `@aDotInTheVoid`
r? `@nnethercote`
…ram_rib, r=petrochenkov

Adjust `with_generic_param_rib`.

Currently all of its call sites construct a `LifetimeRibKind::Generics` value, which `with_generic_param_rib` then deconstructs (and panics if it's a different `LifetimeRibKind` variant).

This commit makes the code simpler and shorter: the call sites just pass in the three values and `with_generic_param_rib` constructs the `LifetimeRibKind::Generics` value from them.

r? `@petrochenkov`
…oli-obk

Make `Clone` a `const_trait`

See [tracking issue](rust-lang#142757) for justification.
…=compiler-errors

rustc_target: document public AbiMap-related fn and variants
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 21, 2025
@rustbot rustbot added 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-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 21, 2025
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 21, 2025

📌 Commit 432c7d0 has been approved by tgross35

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

bors commented Jun 21, 2025

⌛ Testing commit 432c7d0 with merge df4ad9e...

@bors
Copy link
Collaborator

bors commented Jun 21, 2025

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing df4ad9e to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#142384 Bringing rustc_rayon_core in tree as rustc_thread_pool d1a87e0183389f71a48fe7778fc6c5bc9ea8d7b4 (link)
#142476 Insert parentheses around binary operation with attribute b85435472c59da405b4cb9f431d27c2eb84bfb63 (link)
#142485 Marks ADT live if it appears in pattern 31a59273f62012a9c6cdd29d3d8a461d7a20a851 (link)
#142571 Reason about borrowed classes in CopyProp. cf8f9eb0a0c268ed81804e22250bbe126f3a5aa1 (link)
#142677 Add CI check to ensure that rustdoc JSON FORMAT_VERSION i… 1b94767840c84571fe89477da2b5b608333c292b (link)
#142716 Adjust with_generic_param_rib. 28dd5d10de39d502c64d8aa214c4902e185b613a (link)
#142756 Make Clone a const_trait b8f5a37cce6d23634e0892054b59f66992316219 (link)
#142765 rustc_target: document public AbiMap-related fn and variants a0a283ab93b7d8bb74494a3fbefd47e02a8ab64b (link)

previous master: 15c701fbc9

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

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 15c701f (parent) -> df4ad9e (this PR)

Test differences

Show 162 test diffs

Stage 1

  • broadcast::tests::broadcast_after_spawn: [missing] -> pass (J0)
  • broadcast::tests::broadcast_mutual: [missing] -> pass (J0)
  • broadcast::tests::broadcast_mutual_sleepy: [missing] -> pass (J0)
  • broadcast::tests::broadcast_panic_many: [missing] -> pass (J0)
  • broadcast::tests::broadcast_panic_one: [missing] -> pass (J0)
  • broadcast::tests::broadcast_pool: [missing] -> pass (J0)
  • broadcast::tests::broadcast_self: [missing] -> pass (J0)
  • broadcast::tests::broadcast_sleep_race: [missing] -> pass (J0)
  • broadcast::tests::spawn_broadcast_global: [missing] -> pass (J0)
  • broadcast::tests::spawn_broadcast_mutual: [missing] -> pass (J0)
  • broadcast::tests::spawn_broadcast_panic_many: [missing] -> pass (J0)
  • broadcast::tests::spawn_broadcast_panic_one: [missing] -> pass (J0)
  • broadcast::tests::spawn_broadcast_pool: [missing] -> pass (J0)
  • broadcast::tests::spawn_broadcast_self: [missing] -> pass (J0)
  • build_scoped_tls_threadpool: [missing] -> pass (J0)
  • init_zero_threads: [missing] -> pass (J0)
  • join::tests::join_context_neither: [missing] -> pass (J0)
  • join::tests::join_context_second: [missing] -> pass (J0)
  • join::tests::join_counter_overflow: [missing] -> pass (J0)
  • join::tests::panic_b_still_executes: [missing] -> pass (J0)
  • join::tests::panic_propagate_a: [missing] -> pass (J0)
  • join::tests::panic_propagate_b: [missing] -> pass (J0)
  • join::tests::panic_propagate_both: [missing] -> pass (J0)
  • join::tests::sort: [missing] -> pass (J0)
  • join::tests::sort_in_pool: [missing] -> pass (J0)
  • missing_scoped_tls: [missing] -> pass (J0)
  • run_with_large_stack: [missing] -> ignore (J0)
  • run_with_small_stack: [missing] -> ignore (J0)
  • scope::tests::lifo_order: [missing] -> pass (J0)
  • scope::tests::linear_stack_growth: [missing] -> pass (J0)
  • scope::tests::mixed_fifo_lifo_order: [missing] -> pass (J0)
  • scope::tests::mixed_lifetime_scope: [missing] -> pass (J0)
  • scope::tests::mixed_lifetime_scope_fifo: [missing] -> pass (J0)
  • scope::tests::mixed_lifo_fifo_order: [missing] -> pass (J0)
  • scope::tests::nested_fifo_lifo_order: [missing] -> pass (J0)
  • scope::tests::nested_fifo_order: [missing] -> pass (J0)
  • scope::tests::nested_lifo_fifo_order: [missing] -> pass (J0)
  • scope::tests::panic_propagate_nested_scope_spawn: [missing] -> pass (J0)
  • scope::tests::panic_propagate_nested_spawn: [missing] -> pass (J0)
  • scope::tests::panic_propagate_scope: [missing] -> pass (J0)
  • scope::tests::panic_propagate_spawn: [missing] -> pass (J0)
  • scope::tests::panic_propagate_still_execute_1: [missing] -> pass (J0)
  • scope::tests::panic_propagate_still_execute_3: [missing] -> pass (J0)
  • scope::tests::panic_propagate_still_execute_4: [missing] -> pass (J0)
  • scope::tests::scope_divide_and_conquer: [missing] -> pass (J0)
  • scope::tests::scope_empty: [missing] -> pass (J0)
  • scope::tests::scope_fifo_spawn_broadcast: [missing] -> pass (J0)
  • scope::tests::scope_result: [missing] -> pass (J0)
  • scope::tests::scope_spawn_broadcast: [missing] -> pass (J0)
  • scope::tests::scope_spawn_broadcast_barrier: [missing] -> pass (J0)
  • scope::tests::scope_spawn_broadcast_panic_many: [missing] -> pass (J0)
  • scope::tests::scope_spawn_broadcast_panic_one: [missing] -> pass (J0)
  • scope::tests::scope_two: [missing] -> pass (J0)
  • scope::tests::static_scope: [missing] -> pass (J0)
  • scope::tests::static_scope_fifo: [missing] -> pass (J0)
  • scope::tests::update_tree: [missing] -> pass (J0)
  • scope_join: [missing] -> pass (J0)
  • simple_panic: [missing] -> pass (J0)
  • spawn::tests::custom_panic_handler_and_nested_spawn: [missing] -> pass (J0)
  • spawn::tests::custom_panic_handler_and_spawn: [missing] -> pass (J0)
  • spawn::tests::fifo_lifo_order: [missing] -> pass (J0)
  • spawn::tests::fifo_order: [missing] -> pass (J0)
  • spawn::tests::lifo_fifo_order: [missing] -> pass (J0)
  • spawn::tests::lifo_order: [missing] -> pass (J0)
  • spawn::tests::mixed_fifo_lifo_order: [missing] -> pass (J0)
  • spawn::tests::mixed_lifo_fifo_order: [missing] -> pass (J0)
  • spawn::tests::panic_fwd: [missing] -> pass (J0)
  • spawn::tests::spawn_then_join_in_worker: [missing] -> pass (J0)
  • spawn::tests::spawn_then_join_outside_worker: [missing] -> pass (J0)
  • spawn_scoped_tls_threadpool: [missing] -> pass (J0)
  • stack_overflow_crash: [missing] -> pass (J0)
  • tests::cleared_current_thread: [missing] -> pass (J0)
  • tests::configuration: [missing] -> pass (J0)
  • tests::default_pool: [missing] -> pass (J0)
  • tests::exit_callback_called: [missing] -> pass (J0)
  • tests::handler_panics_handled_correctly: [missing] -> pass (J0)
  • tests::worker_thread_index: [missing] -> pass (J0)
  • thread_pool::tests::check_thread_pool_new: [missing] -> pass (J0)
  • thread_pool::tests::failed_thread_stack: [missing] -> pass (J0)
  • thread_pool::tests::in_place_scope_fifo_no_deadlock: [missing] -> pass (J0)
  • thread_pool::tests::in_place_scope_no_deadlock: [missing] -> pass (J0)
  • thread_pool::tests::mutual_install: [missing] -> pass (J0)
  • thread_pool::tests::mutual_install_sleepy: [missing] -> pass (J0)
  • thread_pool::tests::nested_fifo_scopes: [missing] -> pass (J0)
  • thread_pool::tests::panic_propagate: [missing] -> pass (J0)
  • thread_pool::tests::panic_thread_name: [missing] -> pass (J0)
  • thread_pool::tests::scope_fifo_order: [missing] -> pass (J0)
  • thread_pool::tests::scope_lifo_order: [missing] -> pass (J0)
  • thread_pool::tests::sleeper_stop: [missing] -> pass (J0)
  • thread_pool::tests::spawn_fifo_order: [missing] -> pass (J0)
  • thread_pool::tests::spawn_lifo_order: [missing] -> pass (J0)
  • thread_pool::tests::workers_stop: [missing] -> pass (J0)
  • thread_pool::tests::yield_local_to_spawn: [missing] -> pass (J0)
  • thread_pool::tests::yield_now_to_spawn: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/copy-prop/write_to_borrowed.rs: [missing] -> pass (J3)
  • [ui] tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.rs: [missing] -> pass (J3)
  • [ui] tests/ui/lint/dead-code/not-lint-adt-appeared-in-pattern-issue-120770.rs: [missing] -> pass (J3)

Stage 2

  • [ui] tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/dead-code/not-lint-adt-appeared-in-pattern-issue-120770.rs: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/copy-prop/write_to_borrowed.rs: [missing] -> pass (J2)

(and 17 additional test diffs)

Additionally, 45 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 df4ad9e28b9fb973e244ebc65a8167a261b8f45e --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. dist-x86_64-msvc: 6205.5s -> 9749.7s (57.1%)
  2. dist-x86_64-apple: 7783.6s -> 11076.4s (42.3%)
  3. dist-apple-various: 5442.3s -> 7054.2s (29.6%)
  4. x86_64-msvc-1: 9655.2s -> 8201.5s (-15.1%)
  5. dist-aarch64-apple: 4719.8s -> 5428.4s (15.0%)
  6. x86_64-apple-1: 6243.9s -> 7140.7s (14.4%)
  7. i686-msvc-2: 7987.8s -> 7077.9s (-11.4%)
  8. x86_64-apple-2: 4638.5s -> 4153.4s (-10.5%)
  9. x86_64-msvc-ext2: 5431.0s -> 5903.1s (8.7%)
  10. mingw-check-tidy: 71.7s -> 77.2s (7.7%)
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.

@tgross35 tgross35 deleted the rollup-fioob6s branch June 21, 2025 08:53
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (df4ad9e): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.4%, 1.0%] 7
Improvements ✅
(primary)
-1.4% [-2.8%, -0.1%] 2
Improvements ✅
(secondary)
-0.8% [-1.4%, -0.3%] 24
All ❌✅ (primary) -1.4% [-2.8%, -0.1%] 2

Max RSS (memory usage)

Results (primary 0.0%, secondary -1.6%)

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

mean range count
Regressions ❌
(primary)
4.2% [3.3%, 5.6%] 3
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
-3.1% [-5.7%, -1.7%] 4
Improvements ✅
(secondary)
-5.9% [-5.9%, -5.9%] 1
All ❌✅ (primary) 0.0% [-5.7%, 5.6%] 7

Cycles

Results (primary -2.8%, secondary -1.8%)

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)
- - 0
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-1.8% [-2.0%, -1.6%] 2
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Binary size

Results (primary -0.2%, secondary -0.1%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.2%] 5
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.2% [-1.1%, -0.0%] 20
Improvements ✅
(secondary)
-0.1% [-0.4%, -0.0%] 14
All ❌✅ (primary) -0.2% [-1.1%, 0.2%] 25

Bootstrap: 690.617s -> 689.042s (-0.23%)
Artifact size: 371.83 MiB -> 371.85 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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-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.