blob: 031d70fdc8897489f9f87c43453c83601694c9ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#![feature(core_intrinsics)]
#![feature(const_heap)]
use std::intrinsics;
const _X: () = unsafe {
let ptr = intrinsics::const_allocate(4, 4);
intrinsics::const_deallocate(ptr, 4, 2);
//~^ error: evaluation of constant value failed
};
const _Y: () = unsafe {
let ptr = intrinsics::const_allocate(4, 4);
intrinsics::const_deallocate(ptr, 2, 4);
//~^ error: evaluation of constant value failed
};
const _Z: () = unsafe {
let ptr = intrinsics::const_allocate(4, 4);
intrinsics::const_deallocate(ptr, 3, 4);
//~^ error: evaluation of constant value failed
};
const _W: () = unsafe {
let ptr = intrinsics::const_allocate(4, 4);
intrinsics::const_deallocate(ptr, 4, 3);
//~^ error: evaluation of constant value failed
};
fn main() {}
|