firmware-setup icon indicating copy to clipboard operation
firmware-setup copied to clipboard

serial: Switch from `repr(packed)` to `repr(C)`

Open crawfxrd opened this issue 2 years ago • 1 comments

Is this valid?

Need to address unaligned_refrences to update the toolchain.

warning: lint `unaligned_references` has been removed: converted into hard error, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> for more information

crawfxrd avatar Oct 05 '23 23:10 crawfxrd

This probably requires making ReadOnly (and other structs in Io) repr(transparent), to ensure all types are the same size (and thus always aligned to T, assuming the struct itself is aligned).

Alternatively, remove the transmute and initialize each field in SerialPort<Mmio<u32>>::new.

crawfxrd avatar Oct 09 '23 18:10 crawfxrd