1 error[E0080]: evaluation of constant value failed
2 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
4 = note: out-of-bounds pointer arithmetic: alloc3 has size $WORD, so pointer to $TWO_WORDS bytes starting at offset 0 is out-of-bounds
6 note: inside `ptr::const_ptr::<impl *const usize>::offset`
7 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
9 --> $DIR/ptr_comparisons.rs:50:34
11 LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
12 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 error[E0080]: evaluation of constant value failed
15 --> $DIR/ptr_comparisons.rs:53:33
17 LL | unsafe { std::ptr::addr_of!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
18 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: alloc3 has size $WORD, so pointer to 1000 bytes starting at offset 0 is out-of-bounds
20 error[E0080]: evaluation of constant value failed
21 --> $DIR/ptr_comparisons.rs:57:27
23 LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
24 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
26 = help: this code performed an operation that depends on the underlying bytes representing a pointer
27 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
29 error[E0080]: evaluation of constant value failed
30 --> $DIR/ptr_comparisons.rs:61:27
32 LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
35 = help: this code performed an operation that depends on the underlying bytes representing a pointer
36 = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
38 error: aborting due to 4 previous errors
40 For more information about this error, try `rustc --explain E0080`.