|
1 | | -error: encountered partial pointer in final value of constant |
2 | | - --> $DIR/ptr_fragments_in_final.rs:15:1 |
| 1 | +error[E0080]: unable to read parts of a pointer from memory at ALLOC0 |
| 2 | + --> $DIR/ptr_fragments_in_final.rs:18:5 |
3 | 3 | | |
4 | | -LL | const MEMCPY_RET: MaybeUninit<*const i32> = unsafe { |
5 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 4 | +LL | memcpy(&mut ptr2 as *mut _ as *mut _, &ptr as *const _ as *const _, mem::size_of::<&i32>() / 2); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `MEMCPY_RET` failed inside this call |
6 | 6 | | |
7 | | - = note: while pointers can be broken apart into individual bytes during const-evaluation, only complete pointers (with all their bytes in the right order) are supported in the final value |
| 7 | + = help: this code performed an operation that depends on the underlying bytes representing a pointer |
| 8 | + = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported |
| 9 | +note: inside `memcpy` |
| 10 | + --> $DIR/ptr_fragments_in_final.rs:10:26 |
| 11 | + | |
| 12 | +LL | dst.add(i).write(src.add(i).read()); |
| 13 | + | ^^^^^^^^^^^^^^^^^ the failure occurred here |
| 14 | + |
| 15 | +error[E0080]: unable to read parts of a pointer from memory at ALLOC1 |
| 16 | + --> $DIR/ptr_fragments_in_final.rs:42:9 |
| 17 | + | |
| 18 | +LL | buffer[0].thing |
| 19 | + | ^^^^^^^^^^^^^^^ evaluation of `fragment_in_padding::A` failed here |
| 20 | + | |
| 21 | + = help: this code performed an operation that depends on the underlying bytes representing a pointer |
| 22 | + = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported |
8 | 23 |
|
9 | | -error: aborting due to 1 previous error |
| 24 | +error: aborting due to 2 previous errors |
10 | 25 |
|
| 26 | +For more information about this error, try `rustc --explain E0080`. |
0 commit comments