Skip to content

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

Draft
scottmcm wants to merge 2 commits intorust-lang:mainfrom
scottmcm:also-simplify-of-sized-val-alt
Draft

Simplify size/align_of_val<T: Sized> to size/align_of<T> instead#152689
scottmcm wants to merge 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
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@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
Copy link
Collaborator

Queued 85c1367 with parent 1396514, future comparison URL.
There are currently 2 preceding artifacts in the queue.
It will probably take at least ~3.0 hours until the benchmark run finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.

3 participants