File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ use crate::mem;
4
4
use crate :: num:: NonZeroUsize ;
5
5
use crate :: ptr:: NonNull ;
6
6
7
- const fn size_align < T > ( ) -> ( usize , usize ) {
8
- ( mem:: size_of :: < T > ( ) , mem:: align_of :: < T > ( ) )
9
- }
10
-
11
7
/// Layout of a block of memory.
12
8
///
13
9
/// An instance of `Layout` describes a particular layout of memory.
@@ -115,12 +111,11 @@ impl Layout {
115
111
#[ rustc_const_stable( feature = "alloc_layout_const_new" , since = "1.42.0" ) ]
116
112
#[ inline]
117
113
pub const fn new < T > ( ) -> Self {
118
- let ( size, align) = size_align :: < T > ( ) ;
119
114
// SAFETY: the align is guaranteed by Rust to be a power of two and
120
115
// the size+align combo is guaranteed to fit in our address space. As a
121
116
// result use the unchecked constructor here to avoid inserting code
122
117
// that panics if it isn't optimized well enough.
123
- unsafe { Layout :: from_size_align_unchecked ( size , align ) }
118
+ unsafe { Layout :: from_size_align_unchecked ( mem :: size_of :: < T > ( ) , mem :: align_of :: < T > ( ) ) }
124
119
}
125
120
126
121
/// Produces layout describing a record that could be used to
You can’t perform that action at this time.
0 commit comments