Open gpace1 opened 6 years ago
I think that the reason for not deriving copy / clone for incomplete arrays is because they are usually used to allocate past yourself when the array is the last member.
This is still a problem isn't it? I'm now not sure how to go about getting around the eventual error without explicitly defining the structure yourself (which may be the only solution to this).
The way to go here would be to teach #[derive(Debug)]
about these I think. I asked in that rustc issue.
I think bindgen does this for any packed struct that doesn't contain a 0-sized array.
Input C/C++ Header
Bindgen Invocation
Actual Results
Generated bindings:
Rust warning about this
Expected Results
test_struct should derive both clone & copy to get rid of the safe_packed_borrows rustc warning