Skip to content

Rollup of 6 pull requests #144637

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 16 commits into from
Jul 29, 2025
Merged

Rollup of 6 pull requests #144637

merged 16 commits into from
Jul 29, 2025

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Jul 29, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

petrochenkov and others added 16 commits July 28, 2025 17:35
Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
This patch also prepares the affected code in `coverage_attr_on` for some
subsequent changes.
…errors

coverage: Treat `#[automatically_derived]` as `#[coverage(off)]`

One of the contributing factors behind rust-lang#141577 (comment) was the presence of derive-macro-generated code containing nested closures.

Coverage instrumentation already has a heuristic for skipping code marked with `#[automatically_derived]` (rust-lang#120185), because derived code is usually not worth instrumenting, and also has a tendency to trigger vexing edge-case bugs in coverage instrumentation or coverage codegen.

However, the existing heuristic only applied to the associated items directly within an auto-derived impl block, and had no effect on closures or nested items within those associated items.

This PR therefore extends the search for `#[coverage(..)]` attributes to also treat `#[automatically_derived]` as an implied `#[coverage(off)]` for the purposes of coverage instrumentation.

---

This change doesn’t rule out an entire category of bugs, because it only affects code that actually uses the auto-derived attribute. But it should reduce the overall chance of edge-case macro span bugs being observed in the wild.
Simplify `align_of_val::<[T]>(…)` → `align_of::<T>()`

I spotted this while working on the inliner (rust-lang#144561).  In particular, if [`Layout::for_value`](https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.for_value) inlines, then it can be pretty easy to end up with an `align_of_val::<[T]>` today (demo: <https://rust.godbolt.org/z/Tesnscj4a>) where we can save at least a block, if not more, by using the version that's an rvalue and not a call.
…cote

expand: Micro-optimize prelude injection

Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
…r-cast, r=petrochenkov

Account for `.yield` in illegal postfix operator message

Fixes rust-lang#144527
Make resolve_fn_signature responsible for its own rib.

Small simplification in late resolver rib bookkeeping.

r? `@petrochenkov`
Fix typo in `DropGuard` doc

Follows-up rust-lang#144236 (I happened to see the typo yesterday but didn’t think it should delay the PR’s merge so I kept quiet, sorryyyyy).
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 Jul 29, 2025
@Zalathar
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jul 29, 2025

📌 Commit 7088bf5 has been approved by Zalathar

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

bors commented Jul 29, 2025

⌛ Testing commit 7088bf5 with merge ac0cb05...

@bors
Copy link
Collaborator

bors commented Jul 29, 2025

☀️ Test successful - checks-actions
Approved by: Zalathar
Pushing ac0cb05 to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#144560 coverage: Treat #[automatically_derived] as `#[coverage(o… 941f72863d332601c4fe80a7aaa1f9ddcb8f83e5 (link)
#144566 Simplify align_of_val::<[T]>(…)align_of::<T>() 768f10f22964c8b4e1dfd6461d6e18726d20adce (link)
#144587 expand: Micro-optimize prelude injection 37d0e6d8f7cc3a726e436d3de31740777e480b1c (link)
#144589 Account for .yield in illegal postfix operator message 2e74bb6091ce6c9ab27c24812b51dd0f26cd4dd0 (link)
#144615 Make resolve_fn_signature responsible for its own rib. d9035737988b86458b541969f3d061571c085879 (link)
#144634 Fix typo in DropGuard doc d39d6e71202d3a9817880893abc1d72e6cf6ee11 (link)

previous master: 7278554d82

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 7278554 (parent) -> ac0cb05 (this PR)

Test differences

Show 34 test diffs

Stage 1

  • [coverage-map] tests/coverage/auto-derived.rs#auto: [missing] -> pass (J2)
  • [coverage-map] tests/coverage/auto-derived.rs#base: [missing] -> pass (J2)
  • [coverage-map] tests/coverage/auto-derived.rs#on: [missing] -> pass (J2)
  • [coverage-run] tests/coverage/auto-derived.rs#auto: [missing] -> ignore (ignored when the profiler runtime is not available) (J2)
  • [coverage-run] tests/coverage/auto-derived.rs#base: [missing] -> ignore (ignored when the profiler runtime is not available) (J2)
  • [coverage-run] tests/coverage/auto-derived.rs#on: [missing] -> ignore (ignored when the profiler runtime is not available) (J2)
  • [mir-opt] tests/mir-opt/instsimplify/align_of_slice.rs: [missing] -> pass (J2)
  • [mir-opt] tests/mir-opt/pre-codegen/drop_boxed_slice.rs: [missing] -> pass (J2)
  • [ui] tests/ui/coroutine/postfix-yield-after-cast.rs: [missing] -> pass (J2)

Stage 2

  • [coverage-map] tests/coverage/auto-derived.rs#auto: [missing] -> pass (J0)
  • [coverage-map] tests/coverage/auto-derived.rs#base: [missing] -> pass (J0)
  • [coverage-map] tests/coverage/auto-derived.rs#on: [missing] -> pass (J0)
  • [coverage-run] tests/coverage/auto-derived.rs#auto: [missing] -> ignore (ignored when the profiler runtime is not available) (J1)
  • [coverage-run] tests/coverage/auto-derived.rs#base: [missing] -> ignore (ignored when the profiler runtime is not available) (J1)
  • [coverage-run] tests/coverage/auto-derived.rs#on: [missing] -> ignore (ignored when the profiler runtime is not available) (J1)
  • [mir-opt] tests/mir-opt/instsimplify/align_of_slice.rs: [missing] -> pass (J3)
  • [mir-opt] tests/mir-opt/pre-codegen/drop_boxed_slice.rs: [missing] -> pass (J3)
  • [coverage-run] tests/coverage/auto-derived.rs#auto: [missing] -> pass (J4)
  • [coverage-run] tests/coverage/auto-derived.rs#base: [missing] -> pass (J4)
  • [coverage-run] tests/coverage/auto-derived.rs#on: [missing] -> pass (J4)
  • [coverage-run] tests/coverage/auto-derived.rs#auto: [missing] -> ignore (ignored when cross-compiling) (J5)
  • [coverage-run] tests/coverage/auto-derived.rs#base: [missing] -> ignore (ignored when cross-compiling) (J5)
  • [coverage-run] tests/coverage/auto-derived.rs#on: [missing] -> ignore (ignored when cross-compiling) (J5)
  • [ui] tests/ui/coroutine/postfix-yield-after-cast.rs: [missing] -> pass (J6)

Additionally, 10 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 ac0cb05326706ef430a975aa85177e8642f2f457 --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-apple: 7728.5s -> 12529.8s (62.1%)
  2. dist-aarch64-linux: 9008.5s -> 6008.6s (-33.3%)
  3. dist-aarch64-apple: 7099.4s -> 5110.0s (-28.0%)
  4. x86_64-apple-1: 8346.4s -> 6199.0s (-25.7%)
  5. pr-check-2: 2201.4s -> 2650.0s (20.4%)
  6. x86_64-gnu-llvm-19: 2433.0s -> 2892.8s (18.9%)
  7. i686-gnu-nopt-1: 7277.8s -> 8426.4s (15.8%)
  8. dist-apple-various: 4745.7s -> 4010.4s (-15.5%)
  9. aarch64-gnu-llvm-19-2: 2246.8s -> 2533.3s (12.8%)
  10. x86_64-rust-for-linux: 2580.2s -> 2907.6s (12.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.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ac0cb05): 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)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Max RSS (memory usage)

Results (primary 0.7%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.3%, 2.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [-1.3%, 2.0%] 3

Cycles

Results (primary 2.4%, secondary 4.4%)

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

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

Binary size

Results (primary 0.4%)

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

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

Bootstrap: 467.638s -> 468.868s (0.26%)
Artifact size: 376.88 MiB -> 376.82 MiB (-0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Jul 29, 2025
@Zalathar Zalathar deleted the rollup-t1yo1jy branch July 29, 2025 22:55
@panstromek
Copy link
Contributor

perf triage:

Looks like a spurious change in image to me. Erases gain from #144543, which was indentified as codegen unit perturbation in #144543 (comment), but this PR goes even furhter, only to return back to previous state in #144718

All these changes are in the backend part of the breakdown graph, so this truly seems like spurious codegen unit shuffling.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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-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.

10 participants