Skip to content
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

bindgen 0.49.* derives Copy for types containing _IncompleteArrayField #1674

Closed
nagisa opened this issue Nov 12, 2019 · 4 comments
Closed

bindgen 0.49.* derives Copy for types containing _IncompleteArrayField #1674

nagisa opened this issue Nov 12, 2019 · 4 comments

Comments

@nagisa
Copy link
Member

nagisa commented Nov 12, 2019

Input C/C++ Header

typedef struct {
 unsigned int magic;
 unsigned char data[];
} pk;

Bindgen Invocation

    bindgen::Builder::default()
        .header("wrapper.h")
        .no_copy("(?i)mutex")
        .blacklist_type("_bindgen_ty_1")
        .opaque_type("max_align_t")
        .clang_args(nix_cflags.split(" "))

Actual Results

error[E0204]: the trait `Copy` may not be implemented for this type
     --> somewhere deep in the file
      |
69596 | #[derive(Debug, Copy, Clone)]
      |                 ^^^^
...
69599 |     pub data: __IncompleteArrayField<::std::os::raw::c_uchar>,
      |     --------------------------------------------------------- this field does not implement `Copy`

Expected Results

Successful compilation, which is what happened a couple of versions ago…

@nagisa nagisa changed the title bindgen >=0.49.1 derives Copy for types containing _IncompleteArrayField bindgen 0.49.* derives Copy for types containing _IncompleteArrayField Nov 12, 2019
@emilio
Copy link
Contributor

emilio commented Nov 12, 2019

Hmmm... Is this with rust 1.39, and goes away with 1.38 by chance? If so, this is an issue that was fixed in #1627.

@emilio
Copy link
Contributor

emilio commented Nov 12, 2019

I can publish a 0.49 minor version if needed with that PR.

@nagisa
Copy link
Member Author

nagisa commented Nov 12, 2019 via email

@emilio
Copy link
Contributor

emilio commented Nov 13, 2019

Yeah, I'm ~sure the only explanation for this is #1627, which was triggered by a rust change, see there.

If you can't update to 0.50 or 0.51 I'm happy to publish a minor version of 0.49 with that fixed, just lmk.

@emilio emilio closed this as completed Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants