@@ -31,8 +31,6 @@ unsafe extern "Rust" {
3131 #[ rustc_std_internal_symbol]
3232 fn __rust_alloc_zeroed ( size : usize , align : usize ) -> * mut u8 ;
3333
34- #[ rustc_std_internal_symbol]
35- static __rust_no_alloc_shim_is_unstable: u8 ;
3634}
3735
3836/// The global memory allocator.
@@ -85,13 +83,7 @@ pub struct Global;
8583#[ inline]
8684#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
8785pub unsafe fn alloc ( layout : Layout ) -> * mut u8 {
88- unsafe {
89- // Make sure we don't accidentally allow omitting the allocator shim in
90- // stable code until it is actually stabilized.
91- core:: ptr:: read_volatile ( & __rust_no_alloc_shim_is_unstable) ;
92-
93- __rust_alloc ( layout. size ( ) , layout. align ( ) )
94- }
86+ unsafe { __rust_alloc ( layout. size ( ) , layout. align ( ) ) }
9587}
9688
9789/// Deallocates memory with the global allocator.
@@ -168,13 +160,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
168160#[ inline]
169161#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
170162pub unsafe fn alloc_zeroed ( layout : Layout ) -> * mut u8 {
171- unsafe {
172- // Make sure we don't accidentally allow omitting the allocator shim in
173- // stable code until it is actually stabilized.
174- core:: ptr:: read_volatile ( & __rust_no_alloc_shim_is_unstable) ;
175-
176- __rust_alloc_zeroed ( layout. size ( ) , layout. align ( ) )
177- }
163+ unsafe { __rust_alloc_zeroed ( layout. size ( ) , layout. align ( ) ) }
178164}
179165
180166impl Global {
0 commit comments