You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a user can obtain a reference to a type they can clone it, even though that is normally only possible through FFI calls, and will almost always result in UB
It prevents a user from implementing those traits on their own
The only current solution seems to be to turn of those derivations completely, forcing a user to implement them manually on the non-opaque types.
I would suggest to just not derive any of these in case of an opaque struct (since I cannot come up with a use-case were they would actually work)
The text was updated successfully, but these errors were encountered:
Probably worth mentioning that in the bindgen code, these are "forward declared types".
E.g. the opaque annotation does not cause bindgen to generate a struct like the above.
Currently bindgen will generate code that derives for opaque types, e.g.:
This has several problems:
The only current solution seems to be to turn of those derivations completely, forcing a user to implement them manually on the non-opaque types.
I would suggest to just not derive any of these in case of an opaque struct (since I cannot come up with a use-case were they would actually work)
The text was updated successfully, but these errors were encountered: