-
Notifications
You must be signed in to change notification settings - Fork 13.3k
error[E0588]: packed type cannot transitively contain a #[repr(align)]
type
#102733
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
Comments
Excerpt from bindgen generated bindings.rs :
So these are nested struct, and rustc complains about the repr(align(4)) of the innermost struct, when the outer struct has repr(pack(4)). Can someone with better understanding than I have of this packed vs align conflict confirm that rustc is rightfully raising an error ? I would then forward the issue to the bindgen crate. Or is that a rustc error ? |
This is intended behavior as described by The Reference
bindgen's code is very strange here, is it emitting both a |
Very clear now, this is an issue with the bindgen generated code ; and it's even not a matter of relative values of the packed/align parameters. |
Hi!
I'm trying to build the bindgen tutorial example from :
https://rust-lang.github.io/rust-bindgen/tutorial-0.html
=> https://github.com/fitzgen/bindgen-tutorial-bzip2-sys
=> https://fitzgeraldnick.com/2016/12/14/using-libbindgen-in-build-rs.html
It's an exemple binding to bzip2 (just as an exemple ; the author knows about bzip2 and bzip2-sys crates).
I'm using :
After adding some bindgen::Builder config in build.rs to set path to included <bzlib.h> :
I'm getting this error :
I tried with nightly toolchain (currently 1.66.0)
but I get the same error.
I see that issue #67383 with the same problem has been closed.
The text was updated successfully, but these errors were encountered: