@@ -31,8 +31,6 @@ unsafe extern "Rust" {
31
31
#[ rustc_std_internal_symbol]
32
32
fn __rust_alloc_zeroed ( size : usize , align : usize ) -> * mut u8 ;
33
33
34
- #[ rustc_std_internal_symbol]
35
- static __rust_no_alloc_shim_is_unstable: u8 ;
36
34
}
37
35
38
36
/// The global memory allocator.
@@ -85,13 +83,7 @@ pub struct Global;
85
83
#[ inline]
86
84
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
87
85
pub 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 ( ) ) }
95
87
}
96
88
97
89
/// Deallocates memory with the global allocator.
@@ -168,13 +160,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
168
160
#[ inline]
169
161
#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
170
162
pub 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 ( ) ) }
178
164
}
179
165
180
166
impl Global {
0 commit comments