blob: 2cba833a74896ad1f128a5a1fa5f69b50ce47f54 [file] [log] [blame]
error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:6:26
|
LL | const X: bool = unsafe { &1 as *const i32 == &2 as *const i32 };
| -------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
|
= note: `#[deny(const_err)]` on by default
error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:8:27
|
LL | const X2: bool = unsafe { 42 as *const i32 == 43 as *const i32 };
| --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:12:28
|
LL | const Y2: usize = unsafe { &1 as *const i32 as usize + 1 };
| ---------------------------^^^^^^^^^^^^^^^^^^^^^^^^^-------
| |
| "pointer-to-integer cast" needs an rfc before being allowed inside constants
error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:16:26
|
LL | const Z2: i32 = unsafe { *(42 as *const i32) };
| -------------------------^^^^^^^^^^^^^^^^^^^---
| |
| a memory access tried to interpret some bytes as a pointer
error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:17:26
|
LL | const Z3: i32 = unsafe { *(44 as *const i32) };
| -------------------------^^^^^^^^^^^^^^^^^^^---
| |
| a memory access tried to interpret some bytes as a pointer
error: aborting due to 5 previous errors