rust/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
2023-01-11 09:32:08 +00:00

16 lines
310 B
Rust

#![feature(core_intrinsics)]
#![feature(const_heap)]
#![feature(const_mut_refs)]
use std::intrinsics;
const FOO: i32 = foo();
const fn foo() -> i32 {
unsafe {
let _ = intrinsics::const_allocate(4, 3) as *mut i32;
//~^ error: evaluation of constant value failed
}
1
}
fn main() {}