2021-03-31 08:09:16 +00:00
|
|
|
//@ stderr-per-bitwidth
|
2020-12-01 15:39:25 +05:30
|
|
|
// compile-test
|
|
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
#![feature(const_heap)]
|
|
|
|
|
use std::intrinsics;
|
|
|
|
|
|
2025-07-08 00:20:57 +08:00
|
|
|
const BAR: &i32 = unsafe { //~ ERROR: uninitialized memory
|
2025-07-13 15:11:31 +08:00
|
|
|
// Make the pointer immutable to avoid errors related to mutable pointers in constants.
|
|
|
|
|
&*(intrinsics::const_make_global(intrinsics::const_allocate(4, 4)) as *const i32)
|
2025-07-08 00:20:57 +08:00
|
|
|
};
|
2020-12-01 15:39:25 +05:30
|
|
|
fn main() {}
|