rust/tests/ui/consts/const-eval/const_raw_ptr_ops.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
281 B
Rust
Raw Normal View History

fn main() {}
// unconst and bad, will thus error in miri
2022-07-25 08:17:00 +00:00
const X: bool = unsafe { &1 as *const i32 == &2 as *const i32 }; //~ ERROR can't compare
// unconst and bad, will thus error in miri
2022-07-25 08:17:00 +00:00
const X2: bool = unsafe { 42 as *const i32 == 43 as *const i32 }; //~ ERROR can't compare