55#[ stable( feature = "alloc_module" , since = "1.28.0" ) ]
66#[ doc( inline) ]
77pub use core:: alloc:: * ;
8- use core:: ptr:: { self , NonNull } ;
8+ use core:: ptr:: { self , Alignment , NonNull } ;
99use core:: { cmp, hint} ;
1010
1111unsafe extern "Rust" {
@@ -18,19 +18,19 @@ unsafe extern "Rust" {
1818 #[ rustc_nounwind]
1919 #[ rustc_std_internal_symbol]
2020 #[ rustc_allocator_zeroed_variant = "__rust_alloc_zeroed" ]
21- fn __rust_alloc ( size : usize , align : usize ) -> * mut u8 ;
21+ fn __rust_alloc ( size : usize , align : Alignment ) -> * mut u8 ;
2222 #[ rustc_deallocator]
2323 #[ rustc_nounwind]
2424 #[ rustc_std_internal_symbol]
25- fn __rust_dealloc ( ptr : * mut u8 , size : usize , align : usize ) ;
25+ fn __rust_dealloc ( ptr : * mut u8 , size : usize , align : Alignment ) ;
2626 #[ rustc_reallocator]
2727 #[ rustc_nounwind]
2828 #[ rustc_std_internal_symbol]
29- fn __rust_realloc ( ptr : * mut u8 , old_size : usize , align : usize , new_size : usize ) -> * mut u8 ;
29+ fn __rust_realloc ( ptr : * mut u8 , old_size : usize , align : Alignment , new_size : usize ) -> * mut u8 ;
3030 #[ rustc_allocator_zeroed]
3131 #[ rustc_nounwind]
3232 #[ rustc_std_internal_symbol]
33- fn __rust_alloc_zeroed ( size : usize , align : usize ) -> * mut u8 ;
33+ fn __rust_alloc_zeroed ( size : usize , align : Alignment ) -> * mut u8 ;
3434
3535 #[ rustc_nounwind]
3636 #[ rustc_std_internal_symbol]
@@ -92,7 +92,7 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
9292 // stable code until it is actually stabilized.
9393 __rust_no_alloc_shim_is_unstable_v2 ( ) ;
9494
95- __rust_alloc ( layout. size ( ) , layout. align ( ) )
95+ __rust_alloc ( layout. size ( ) , layout. alignment ( ) )
9696 }
9797}
9898
@@ -112,7 +112,7 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
112112#[ inline]
113113#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
114114pub unsafe fn dealloc ( ptr : * mut u8 , layout : Layout ) {
115- unsafe { __rust_dealloc ( ptr, layout. size ( ) , layout. align ( ) ) }
115+ unsafe { __rust_dealloc ( ptr, layout. size ( ) , layout. alignment ( ) ) }
116116}
117117
118118/// Reallocates memory with the global allocator.
@@ -132,7 +132,7 @@ pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
132132#[ inline]
133133#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
134134pub unsafe fn realloc ( ptr : * mut u8 , layout : Layout , new_size : usize ) -> * mut u8 {
135- unsafe { __rust_realloc ( ptr, layout. size ( ) , layout. align ( ) , new_size) }
135+ unsafe { __rust_realloc ( ptr, layout. size ( ) , layout. alignment ( ) , new_size) }
136136}
137137
138138/// Allocates zero-initialized memory with the global allocator.
@@ -175,7 +175,7 @@ pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 {
175175 // stable code until it is actually stabilized.
176176 __rust_no_alloc_shim_is_unstable_v2 ( ) ;
177177
178- __rust_alloc_zeroed ( layout. size ( ) , layout. align ( ) )
178+ __rust_alloc_zeroed ( layout. size ( ) , layout. alignment ( ) )
179179 }
180180}
181181
0 commit comments