rust/tests/ui/consts/const-eval/heap/alloc_intrinsic_uninit.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
289 B
Rust
Raw Normal View History

// stderr-per-bitwidth
2020-12-01 04:09:25 -06:00
// compile-test
#![feature(core_intrinsics)]
#![feature(const_heap)]
#![feature(const_mut_refs)]
use std::intrinsics;
const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) };
//~^ error: it is undefined behavior to use this value
fn main() {}