forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst_raw_ptr_ops.stderr
36 lines (31 loc) · 1.58 KB
/
const_raw_ptr_ops.stderr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:6:1
|
LL | const X: bool = unsafe { &1 as *const i32 == &2 as *const i32 }; //~ ERROR any use of this
| ^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------------^^^
| |
| "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:12:1
|
LL | const Y2: usize = unsafe { &1 as *const i32 as usize + 1 }; //~ ERROR any use of this
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------^^^
| |
| "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:16:1
|
LL | const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR any use of this value will cause
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
| |
| 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:1
|
LL | const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR any use of this value will cause
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
| |
| a memory access tried to interpret some bytes as a pointer
error: aborting due to 4 previous errors