Unaligned read of `MIDIPacket::length` triggers UB check in recent Rust
Closed this issue · 0 comments
Boddlnagg commented
Because MIDIPacket
s are unaligned on non-ARM platforms, accesing their length
and timeStamp
fields must happen through read_unaligned
. But this is not needed (and would produce worse machine code) on ARM.
These checks have been added in Rust 1.70 (https://releases.rs/docs/1.70.0/, rust-lang/rust#98112).