Skip to content

Comments

Pass alignments through the shim as Alignment (not usize)#152605

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
scottmcm:box-drop-alignment
Feb 15, 2026
Merged

Pass alignments through the shim as Alignment (not usize)#152605
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
scottmcm:box-drop-alignment

Conversation

@scottmcm
Copy link
Member

We're using Layout on both sides, so might as well skip the transmutes back and forth to usize.

The mir-opt test shows that doing so allows simplifying the boxed-slice drop slightly, for example.

@rustbot rustbot added 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. labels Feb 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 14, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet

@scottmcm
Copy link
Member Author

I don't think this'll make a big difference, but to make sure it doesn't do something terrible,
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 14, 2026
Pass alignments through the shim as `Alignment` (not `usize`)
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 14, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 14, 2026

☀️ Try build successful (CI)
Build commit: cbb8a9d (cbb8a9dfbcf43b0848077acc814b5f9f74f33862, parent: f403dee04e6a801fe0f49a9c351fcd2ae8edd37c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cbb8a9d): 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.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.6% [-0.6%, -0.6%] 1

Max RSS (memory usage)

Results (primary 4.3%, secondary 3.0%)

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

mean range count
Regressions ❌
(primary)
4.3% [3.3%, 5.3%] 2
Regressions ❌
(secondary)
5.1% [5.0%, 5.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) 4.3% [3.3%, 5.3%] 2

Cycles

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

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.4%, -0.1%] 2
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 2
All ❌✅ (primary) -0.2% [-0.4%, -0.1%] 2

Bootstrap: 481.836s -> 481.056s (-0.16%)
Artifact size: 398.12 MiB -> 398.12 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 14, 2026
We're using `Layout` on both sides, so might as well skip the transmutes back and forth to `usize`.

The mir-opt test shows that doing so allows simplifying the boxed-slice drop slightly, for example.
@bjorn3
Copy link
Member

bjorn3 commented Feb 14, 2026

This should be fine given that Alignment is repr(transparent).

@Mark-Simulacrum
Copy link
Member

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 14, 2026

📌 Commit 774268a has been approved by Mark-Simulacrum

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 14, 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 15, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 15, 2026

☀️ Test successful - CI
Approved by: Mark-Simulacrum
Duration: 3h 13m 22s
Pushing 2219766 to main...

@rust-bors rust-bors bot merged commit 2219766 into rust-lang:main Feb 15, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 15, 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 4c37f6d (parent) -> 2219766 (this PR)

Test differences

Show 2 test diffs

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

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 2219766af622ad1f051ca96ae40650106b1bd9bd --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: 2h 26m -> 3h 4m (+25.9%)
  2. dist-x86_64-apple: 2h 49m -> 2h 17m (-19.1%)
  3. aarch64-apple: 3h 35m -> 2h 54m (-18.9%)
  4. x86_64-gnu-llvm-21-2: 1h 32m -> 1h 43m (+12.2%)
  5. x86_64-gnu-tools: 1h 3m -> 56m 12s (-11.0%)
  6. dist-aarch64-msvc: 1h 39m -> 1h 29m (-9.8%)
  7. dist-aarch64-llvm-mingw: 1h 44m -> 1h 34m (-9.0%)
  8. dist-riscv64-linux: 1h 20m -> 1h 27m (+8.9%)
  9. dist-android: 28m 3s -> 25m 46s (-8.1%)
  10. dist-aarch64-linux: 1h 44m -> 1h 52m (+7.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
Collaborator

Finished benchmarking commit (2219766): 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.5% [0.5%, 0.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results (primary 1.6%, secondary -1.2%)

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

mean range count
Regressions ❌
(primary)
5.3% [2.3%, 8.0%] 4
Regressions ❌
(secondary)
4.4% [4.4%, 4.4%] 1
Improvements ✅
(primary)
-3.3% [-3.9%, -3.0%] 3
Improvements ✅
(secondary)
-6.7% [-6.7%, -6.7%] 1
All ❌✅ (primary) 1.6% [-3.9%, 8.0%] 7

Cycles

Results (secondary -3.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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-4.2%, -3.2%] 2
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.7%, 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
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 14
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 2
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) -0.7% [-0.7%, -0.7%] 2

Bootstrap: 480.702s -> 485.129s (0.92%)
Artifact size: 397.88 MiB -> 398.01 MiB (0.03%)

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. 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.

6 participants