blob: e44a3f7a23c2c2781cb32468dd5002c245a98507 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
// Ensure that we reject interning `const_allocate`d allocations in the final value of constants
// if they have not been made global through `const_make_global`. This covers the case where the
// pointer is even still mutable, which used to ICE.
#![feature(core_intrinsics)]
#![feature(const_heap)]
use std::intrinsics;
const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 };
//~^ error: encountered `const_allocate` pointer in final value that was not made global
fn main() {}
|