Skip to content

Commit

Permalink
Describe why size_align have not been inlined so far
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Dec 10, 2020
1 parent f0f6877 commit cf5bd26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/core/src/alloc/layout.rs
Expand Up @@ -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<T>() -> (usize, usize) {
(mem::size_of::<T>(), mem::align_of::<T>())
}
Expand Down

0 comments on commit cf5bd26

Please sign in to comment.