2023-08-02 09:14:36 -05:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
#![feature(const_intrinsic_raw_eq)]
|
|
|
|
|
|
|
|
const RAW_EQ_PADDING: bool = unsafe {
|
|
|
|
std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
|
|
|
|
//~^ ERROR evaluation of constant value failed
|
|
|
|
//~| requires initialized memory
|
|
|
|
};
|
|
|
|
|
|
|
|
const RAW_EQ_PTR: bool = unsafe {
|
|
|
|
std::intrinsics::raw_eq(&(&0), &(&1))
|
|
|
|
//~^ ERROR evaluation of constant value failed
|
2024-07-31 13:26:08 -05:00
|
|
|
//~| unable to turn pointer into integer
|
2023-08-02 09:14:36 -05:00
|
|
|
};
|
|
|
|
|
2024-08-27 12:29:52 -05:00
|
|
|
const RAW_EQ_NOT_ALIGNED: bool = unsafe {
|
|
|
|
let arr = [0u8; 4];
|
|
|
|
let aref = &*arr.as_ptr().cast::<i32>();
|
|
|
|
std::intrinsics::raw_eq(aref, aref)
|
|
|
|
//~^ ERROR evaluation of constant value failed
|
|
|
|
//~| alignment
|
|
|
|
};
|
|
|
|
|
2023-08-02 09:14:36 -05:00
|
|
|
pub fn main() {
|
|
|
|
}
|