ashkitten / roccat-tools

Tools for controlling roccat devices, based on the work by erazor_de
MIT License
1 stars 1 forks source link

Heads-up: `derive(Debug)` on packed struct with non-Copy fields might fail to build in future rustc #3

Open RalfJung opened 1 year ago

RalfJung commented 1 year ago

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:

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 on packed, so we'd like to change rustc here.

There are two easy ways to keep this code working:

ashkitten commented 1 year ago

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!