@@ -2368,18 +2368,6 @@ extern "rust-intrinsic" {
2368
2368
#[ rustc_nounwind]
2369
2369
pub fn ptr_guaranteed_cmp < T > ( ptr : * const T , other : * const T ) -> u8 ;
2370
2370
2371
- /// Allocates a block of memory at compile time.
2372
- /// At runtime, just returns a null pointer.
2373
- ///
2374
- /// # Safety
2375
- ///
2376
- /// - The `align` argument must be a power of two.
2377
- /// - At compile time, a compile error occurs if this constraint is violated.
2378
- /// - At runtime, it is not checked.
2379
- #[ rustc_const_unstable( feature = "const_heap" , issue = "79597" ) ]
2380
- #[ rustc_nounwind]
2381
- pub fn const_allocate ( size : usize , align : usize ) -> * mut u8 ;
2382
-
2383
2371
/// Deallocates a memory which allocated by `intrinsics::const_allocate` at compile time.
2384
2372
/// At runtime, does nothing.
2385
2373
///
@@ -2594,6 +2582,22 @@ pub(crate) const unsafe fn debug_assertions() -> bool {
2594
2582
cfg ! ( debug_assertions)
2595
2583
}
2596
2584
2585
+ /// Allocates a block of memory at compile time.
2586
+ /// At runtime, just returns a null pointer.
2587
+ ///
2588
+ /// # Safety
2589
+ ///
2590
+ /// - The `align` argument must be a power of two.
2591
+ /// - At compile time, a compile error occurs if this constraint is violated.
2592
+ /// - At runtime, it is not checked.
2593
+ #[ rustc_const_unstable( feature = "const_heap" , issue = "79597" ) ]
2594
+ #[ rustc_nounwind]
2595
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
2596
+ pub const unsafe fn const_allocate ( _size : usize , _align : usize ) -> * mut u8 {
2597
+ // const eval overrides this function, but runtime code should always just return null pointers.
2598
+ crate :: ptr:: null_mut ( )
2599
+ }
2600
+
2597
2601
// Some functions are defined here because they accidentally got made
2598
2602
// available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>.
2599
2603
// (`transmute` also falls into this category, but it cannot be wrapped due to the
0 commit comments