Skip to content

Comments

Simplify size/align_of_val<T: Sized> to size/align_of<T> instead#152689

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
scottmcm:also-simplify-of-sized-val-alt
Feb 20, 2026
Merged

Simplify size/align_of_val<T: Sized> to size/align_of<T> instead#152689
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
scottmcm:also-simplify-of-sized-val-alt

Conversation

@scottmcm
Copy link
Member

@scottmcm scottmcm commented Feb 16, 2026

This is relevant to things like Box<[u8; 1024]> where the drop looks at the size_of_val (since obviously it might be DST in general) but where we don't actually need to do that since it's always that same value for the Sized type.

(Equivalent to #152681, but flipped in the rebase so it can land before #152641 instead of depending on it.)

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 16, 2026
@scottmcm
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 16, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 16, 2026
Simplify `size/align_of_val<T: Sized>` to `size/align_of<T>` instead
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 16, 2026

☀️ Try build successful (CI)
Build commit: 85c1367 (85c13679ed60d98f876a8f50c0b7505fb1ea3260, parent: 139651428df86cf88443295542c12ea617cbb587)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (85c1367): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -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
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-0.5% [-0.5%, -0.5%] 2
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

Max RSS (memory usage)

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

Cycles

Results (primary -2.4%, secondary 2.7%)

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

Binary size

Results (primary -0.3%)

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)
-0.3% [-0.6%, -0.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-0.6%, -0.0%] 2

Bootstrap: 482.657s -> 485.908s (0.67%)
Artifact size: 397.96 MiB -> 397.86 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 16, 2026
@scottmcm
Copy link
Member Author

r? @cjgillot

@scottmcm scottmcm marked this pull request as ready for review February 16, 2026 06:29
@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2026

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 16, 2026
@cjgillot
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 17, 2026

📌 Commit 649e027 has been approved by cjgillot

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 Feb 17, 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 Feb 20, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

☀️ Test successful - CI
Approved by: cjgillot
Duration: 3h 35m
Pushing ef70767 to main...

@rust-bors rust-bors bot merged commit ef70767 into rust-lang:main Feb 20, 2026
13 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 20, 2026
@github-actions
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 7f99507 (parent) -> ef70767 (this PR)

Test differences

Show 6 test diffs

Stage 1

  • [mir-opt] tests/mir-opt/instsimplify/align_or_size_of_sized_val.rs: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/pre-codegen/drop_box_of_sized.rs: [missing] -> pass (J1)

Stage 2

  • [mir-opt] tests/mir-opt/instsimplify/align_or_size_of_sized_val.rs: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/pre-codegen/drop_box_of_sized.rs: [missing] -> pass (J0)

Additionally, 2 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 ef70767064ab87b0a41400f69e1dc0b55c8d5284 --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-aarch64-apple: 1h 44m -> 3h 13m (+84.5%)
  2. dist-x86_64-apple: 2h 28m -> 3h 12m (+29.6%)
  3. x86_64-gnu-llvm-21-3: 1h 36m -> 1h 53m (+16.7%)
  4. dist-x86_64-mingw: 2h 18m -> 2h 40m (+15.7%)
  5. dist-apple-various: 1h 43m -> 1h 28m (-14.8%)
  6. i686-gnu-nopt-1: 1h 56m -> 2h 10m (+12.0%)
  7. x86_64-gnu-llvm-20: 1h 15m -> 1h 6m (-11.0%)
  8. dist-ohos-armv7: 1h 20m -> 1h 12m (-9.8%)
  9. aarch64-gnu-llvm-20-2: 49m 54s -> 45m 9s (-9.5%)
  10. dist-powerpc64le-linux-gnu: 1h 41m -> 1h 31m (-9.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.

@scottmcm scottmcm deleted the also-simplify-of-sized-val-alt branch February 20, 2026 01:47
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ef70767): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary -1.2%)

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

mean range count
Regressions ❌
(primary)
2.8% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.3% [-3.4%, -3.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.2% [-3.4%, 2.8%] 3

Cycles

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

Binary size

Results (primary -0.0%, secondary -0.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)
- - 0
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 7
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 4
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 7

Bootstrap: 481.508s -> 496.246s (3.06%)
Artifact size: 397.92 MiB -> 397.86 MiB (-0.01%)

scottmcm added a commit to scottmcm/rust that referenced this pull request Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants