about summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/raw-pointer-ub.stderr
blob: 00af20a722daeee3f8156aa75041b5319184e9a7 (plain)
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
36
error[E0080]: accessing memory based on pointer with alignment 1, but alignment 4 is required
  --> $DIR/raw-pointer-ub.rs:4:16
   |
LL |     let _val = *ptr;
   |                ^^^^ evaluation of `MISALIGNED_LOAD` failed here

error[E0080]: accessing memory based on pointer with alignment 1, but alignment 4 is required
  --> $DIR/raw-pointer-ub.rs:11:5
   |
LL |     *ptr = 0;
   |     ^^^^^^^^ evaluation of `MISALIGNED_STORE` failed here

error[E0080]: accessing memory with alignment 1, but alignment 4 is required
  --> $DIR/raw-pointer-ub.rs:19:5
   |
LL |     y.copy_to_nonoverlapping(&mut z, 1);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `MISALIGNED_COPY` failed inside this call
   |
note: inside `std::ptr::copy_nonoverlapping::<u32>`
  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL

error[E0080]: accessing memory based on pointer with alignment 4, but alignment 16 is required
  --> $DIR/raw-pointer-ub.rs:33:16
   |
LL |     let _val = (*ptr).0;
   |                ^^^^^^^^ evaluation of `MISALIGNED_FIELD` failed here

error[E0080]: memory access failed: attempting to access 8 bytes, but got ALLOC0 which is only 4 bytes from the end of the allocation
  --> $DIR/raw-pointer-ub.rs:40:16
   |
LL |     let _val = *ptr;
   |                ^^^^ evaluation of `OOB` failed here

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0080`.