ruabmbua / enet-sys

Raw rust bindings to the enet C library
MIT License
19 stars 14 forks source link

Compile error with stable Rust toolchain E0588 #16

Closed mvklingeren closed 2 years ago

mvklingeren commented 2 years ago

After the bindgen update, this doesnt build well with the latest Rust 1.6 toolchain (stable) on Windows:

cmake --version cmake version 3.23.1

rustc --version rustc 1.60.0 (7737e0b5c 2022-04-04)

Windows SDK: 10.0.22000.0 latest

C:\source\enet-sys-mvk> cargo build Compiling enet-sys v1.0.0 (C:\source\enet-sys-mvk) error[E0588]: packed type cannot transitively contain a#[repr(align)]` type --> C:\source\enet-sys-mvk\target\debug\build\enet-sys-476a2ef1944315e3\out/bindings.rs:59928:1 59928 / pub struct _IMAGE_TLS_DIRECTORY64 { 59929 pub StartAddressOfRawData: ULONGLONG, 59930 pub EndAddressOfRawData: ULONGLONG, 59931 pub AddressOfIndex: ULONGLONG, ... 59934 pub __bindgen_anon_1: _IMAGE_TLS_DIRECTORY64__bindgen_ty_1, 59935 } _^
note: _IMAGE_TLS_DIRECTORY64__bindgen_ty_1__bindgen_ty_1 has a #[repr(align)] attribute --> C:\source\enet-sys-mvk\target\debug\build\enet-sys-476a2ef1944315e3\out/bindings.rs:59945:1 59945 / pub struct _IMAGE_TLS_DIRECTORY64bindgen_ty_1bindgen_ty_1 { 59946 pub _bitfield_align_1: [u32; 0], 59947 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, 59948 } _^ note: _IMAGE_TLS_DIRECTORY64 contains a field of type _IMAGE_TLS_DIRECTORY64__bindgen_ty_1 --> C:\source\enet-sys-mvk\target\debug\build\enet-sys-476a2ef1944315e3\out/bindings.rs:59934:9
59934 pub __bindgen_anon_1: _IMAGE_TLS_DIRECTORY64__bindgen_ty_1,
^^^^^^^^^^^^^^^^

note: ...which contains a field of type _IMAGE_TLS_DIRECTORY64__bindgen_ty_1__bindgen_ty_1 --> C:\source\enet-sys-mvk\target\debug\build\enet-sys-476a2ef1944315e3\out/bindings.rs:59940:9 | 59940 | pub __bindgen_anon_1: _IMAGE_TLS_DIRECTORY64bindgen_ty_1bindgen_ty_1, | ^^^^^^^^^^^^^^^^

For more information about this error, try rustc --explain E0588. error: could not compile enet-sys due to previous error`

Adding the following to build.rs solves this though: .blocklisttype("?P?IMAGE_TLS_DIRECTORY.*")