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