2025-04-05 19:19:56 +03:00
|
|
|
//@ dont-require-annotations: NOTE
|
|
|
|
|
|
2020-12-01 19:48:09 +05:30
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
#![feature(const_heap)]
|
|
|
|
|
use std::intrinsics;
|
|
|
|
|
|
2025-05-28 10:29:08 +00:00
|
|
|
const FOO: i32 = foo(); //~ ERROR 3 is not a power of 2
|
2020-12-01 19:48:09 +05:30
|
|
|
const fn foo() -> i32 {
|
|
|
|
|
unsafe {
|
2025-04-05 19:19:56 +03:00
|
|
|
let _ = intrinsics::const_allocate(4, 3) as *mut i32; //~ NOTE inside `foo`
|
2020-12-01 19:48:09 +05:30
|
|
|
}
|
|
|
|
|
1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|