]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
df1e6f8e4c4f0d7820dba78648a13ecefb7e1aad
[rust.git] / src / test / ui / consts / const-eval / const_raw_ptr_ops.stderr
1 error: this constant cannot be used
2   --> $DIR/const_raw_ptr_ops.rs:16:1
3    |
4 LL | const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR cannot be used
5    | ^^^^^^^^^^^^^^^^------------------------------------^
6    |                 |
7    |                 "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
8    |
9    = note: #[deny(const_err)] on by default
10
11 error: this constant cannot be used
12   --> $DIR/const_raw_ptr_ops.rs:22:1
13    |
14 LL | const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR cannot be used
15    | ^^^^^^^^^^^^^^^^^^-----------------------------^
16    |                   |
17    |                   "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
18
19 error: this constant cannot be used
20   --> $DIR/const_raw_ptr_ops.rs:26:1
21    |
22 LL | const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR cannot be used
23    | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
24    |                          |
25    |                          a memory access tried to interpret some bytes as a pointer
26
27 error: this constant cannot be used
28   --> $DIR/const_raw_ptr_ops.rs:27:1
29    |
30 LL | const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR cannot be used
31    | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
32    |                          |
33    |                          a memory access tried to interpret some bytes as a pointer
34
35 error: aborting due to 4 previous errors
36