-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No option to disable derive(Debug) #432
Comments
This one is easy to support if there's a good use case for it, and this one seems like a decent one. This is really easy to add. I'm digging in other problems now, but will do it. |
Overlaps second bullet of #424 |
It seems like derive debug is also added to packed structures. This generates the following warning on build: warning: #[derive] can't be used on a #[repr(packed)] struct that does not derive Copy (error E0133)
--> virtio_gen/src/virtio_net.rs:684:10
|
684 | #[derive(Debug, Default)]
| ^^^^^
|
= note: #[warn(safe_packed_borrows)] on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043> The structure that is causing the previous error: #[repr(C, packed)]
#[derive(Debug, Default)]
pub struct virtio_net_ctrl_mac {
pub entries: __virtio32,
pub macs: __IncompleteArrayField<[__u8; 6usize]>,
} Our workaround right now is to manually remove the debug derive, but it would be nice to have an argument like --no-derive-debug=virtio_net_ctrl_mac. |
Can you file a new issue for that? It's hard to keep track of comments in closed issues. IIUC what you want is an option to individually control |
Yap, that is exactly what I was thinking about. I'll open a new issue. |
Once #429 is fixed, it's once again possible to have types in your Rust structs that don't implement Debug. Therefore, deriving Debug is not possible for such types. bindgen 0.19 had a
derive_debug
option to turn off generating Debug.The text was updated successfully, but these errors were encountered: