Files
rust/tests/ui/consts/const-eval/heap/alloc_intrinsic_uninit.rs
Deadbeef fd48b7b8dd Comment more code and make tests clearer
Co-Authored-By: Ralf Jung <post@ralfj.de>
2025-07-16 00:50:20 +08:00

12 lines
368 B
Rust

//@ stderr-per-bitwidth
// compile-test
#![feature(core_intrinsics)]
#![feature(const_heap)]
use std::intrinsics;
const BAR: &i32 = unsafe { //~ ERROR: uninitialized memory
// 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)
};
fn main() {}