diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs index 57c6624b64f..c572c66ce32 100644 --- a/library/core/src/alloc/layout.rs +++ b/library/core/src/alloc/layout.rs @@ -4,6 +4,12 @@ use crate::mem; use crate::num::NonZeroUsize; use crate::ptr::NonNull; +// While this function is used in one place and its implementation +// could be inlined, the previous attempts to do so made rustc +// slower: +// +// * https://github.com/rust-lang/rust/pull/72189 +// * https://github.com/rust-lang/rust/pull/79827 const fn size_align() -> (usize, usize) { (mem::size_of::(), mem::align_of::()) }