error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
--> imageflow_core/src/graphics/transpose.rs:122:13
|
122 | *(&mut *(*to).pixels.offset(
| _____________^______-
| |_____________|
| ||
123 | || x.wrapping_mul(4u32)
124 | || .wrapping_add(y.wrapping_mul((*to).stride)) as isize,
125 | || ) as *mut libc::c_uchar as *mut u32) = *(&mut *(*from).pixels.offset(
| ||_____________- backing allocation comes from here
... |
128 | | ) as *mut libc::c_uchar
129 | | as *mut u32);
| |_____________________________^
|
= note: casting from `u8` (1 bytes) to `u32` (4 bytes)
= note: `#[deny(invalid_reference_casting)]` on by default
Fixes this build error with current Rust nightly: