Skip to content

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

@nagisa

Description

@nagisa

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…

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions