Closed VariableExp0rt closed 6 months ago
That's intended, since we don't know how much memory we'd need to copy?
In general trailing incomplete array members are used to implement dynamically sized data. That can't implement Copy
in rust, because it can't be allocated on the stack (easily at least), and bindgen doesn't know the length of the array per se.
Closing because I don't think generating Copy there is reasonable, but lmk if I'm missing something.
Input C/C++ Header
Bindgen Invocation
Actual Results
Expected Results
::std::marker::Copy
is implemented for__IncompleteArrayField<__u64>
It seems that a few of the other examples I can find related to this field imply that it can be
Copy
, but perhaps I am missing some constraints about why it's omitted here (I am new to bindgen and Rust). Should I be doing this manually becausePhantomData<T>
cannot be sure thatT
is actuallyCopy
? For instance the below works but I'm unsure it's "sound":I should also mention I'm using
blocklisted_item_implements_trait
inParseCallback
to get the behaviour I need too (so that the io_uring types can implement the necessary traits).Thanks!