Skip to content

Commit 05dfaba

Browse files
committed
Auto merge of #79827 - tmiasko:size-align, r=kennytm
Describe why `size_align` have not been inlined so far although it is used only in one place.
2 parents 18d855b + cf5bd26 commit 05dfaba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/core/src/alloc/layout.rs

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ use crate::mem;
44
use crate::num::NonZeroUsize;
55
use crate::ptr::NonNull;
66

7+
// While this function is used in one place and its implementation
8+
// could be inlined, the previous attempts to do so made rustc
9+
// slower:
10+
//
11+
// * https://github.com/rust-lang/rust/pull/72189
12+
// * https://github.com/rust-lang/rust/pull/79827
713
const fn size_align<T>() -> (usize, usize) {
814
(mem::size_of::<T>(), mem::align_of::<T>())
915
}

0 commit comments

Comments
 (0)