Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cf5bd26

Browse files
committedDec 10, 2020
Describe why size_align have not been inlined so far
1 parent f0f6877 commit cf5bd26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎library/core/src/alloc/layout.rs

Lines changed: 6 additions & 0 deletions
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)
Please sign in to comment.