capstone-rust / capstone-rs

high-level Capstone system bindings for Rust
217 stars 75 forks source link

Update bindgen #78

Closed losynix closed 4 years ago

losynix commented 4 years ago

capstone-sys doesn't build with the bindgen feature on latest stable (rust 1.39):

$ cargo build --features use_bindgen
[...]
    Compiling capstone-sys v0.10.0 (/home/user/src/capstone-rs/capstone-sys)
error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /home/user/src/capstone-rs/target/debug/build/capstone-sys-46af2af488fb2973/out/capstone.rs:885:5
    |
885 |     pub operands: [cs_arm_op; 36usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `core::array::LengthAtMost32` is not implemented for `[cs_arm_op; 36]`
    |
    = note: required because of the requirements on the impl of `core::fmt::Debug` for `[cs_arm_op; 36]`
    = note: required because of the requirements on the impl of `core::fmt::Debug` for `&[cs_arm_op; 36]`
    = note: required for the cast to the object type `dyn core::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
     --> /home/user/src/capstone-rs/target/debug/build/capstone-sys-46af2af488fb2973/out/capstone.rs:10809:5
      |
10809 |     pub op_str: [libc::c_char; 160usize],
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `core::array::LengthAtMost32` is not implemented for `[i8; 160]`
      |
      = note: required because of the requirements on the impl of `core::fmt::Debug` for `[i8; 160]`
      = note: required because of the requirements on the impl of `core::fmt::Debug` for `&[i8; 160]`
      = note: required for the cast to the object type `dyn core::fmt::Debug`

It seems to be a bindgen issue (https://github.com/rust-lang/rust/issues/65522), upgrading to the latest version (0.52.0) fixes it.