This crate is one of the few that was identified as part of https://github.com/rust-lang/rust/pull/104429 to have a packed struct with a built-in derive and a non-Copy field where furthermore the packed does not actually change the layout at all:
All fields of this struct have alignment 1, so packing doesn't affect layout. The fact that derive(Debug) works right now is kind of an accident that is now blocking other progress on packed, so we'd like to change rustc here.
There are two easy ways to keep this code working:
remove repr(packed), or
add derive(Copy) to LightControlState and LightControlWriteCheck
thank you for the heads-up! this project is sort of abandoned since i don't have the relevant hardware anymore, but prs always welcome if anyone actually uses it!
This crate is one of the few that was identified as part of https://github.com/rust-lang/rust/pull/104429 to have a packed struct with a built-in derive and a non-
Copy
field where furthermore thepacked
does not actually change the layout at all:https://github.com/ashkitten/roccat-tools/blob/08d5d6a224314bc207d34109354aaa86954851b9/libroccat/src/device/ryosmkfx/light_control.rs#L20-L31
All fields of this struct have alignment 1, so packing doesn't affect layout. The fact that
derive(Debug)
works right now is kind of an accident that is now blocking other progress onpacked
, so we'd like to change rustc here.There are two easy ways to keep this code working:
repr(packed)
, orderive(Copy)
toLightControlState
andLightControlWriteCheck