mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 03:07:25 +00:00

Simplify `align_of_val::<[T]>(…)` → `align_of::<T>()` I spotted this while working on the inliner (rust-lang/rust#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.