mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-30 04:24:26 +00:00
15 lines
282 B
Rust
15 lines
282 B
Rust
#![feature(core_intrinsics)]
|
|
#![feature(const_heap)]
|
|
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() {}
|