summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_zero_sized.rs
blob: 84fb4d2ea870f2b73802b397e7d95563eb4978dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass
#![feature(core_intrinsics)]
#![feature(const_heap)]
#![feature(inline_const)]

use std::intrinsics;

fn main() {
    const {
        unsafe {
            let ptr1 = intrinsics::const_allocate(0, 0);
            let ptr2 = intrinsics::const_allocate(0, 0);
            intrinsics::const_deallocate(ptr1, 0, 0);
            intrinsics::const_deallocate(ptr2, 0, 0);
        }
    }
}