2020-12-01 08:18:09 -06:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
#![feature(const_heap)]
|
|
|
|
#![feature(const_mut_refs)]
|
|
|
|
use std::intrinsics;
|
|
|
|
|
|
|
|
const FOO: i32 = foo();
|
|
|
|
const fn foo() -> i32 {
|
|
|
|
unsafe {
|
2022-01-25 22:06:09 -06:00
|
|
|
let _ = intrinsics::const_allocate(4, 3) as *mut i32;
|
2021-06-18 12:31:56 -05:00
|
|
|
//~^ error: evaluation of constant value failed
|
2020-12-01 08:18:09 -06:00
|
|
|
}
|
|
|
|
1
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|