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