rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Wrap the array representation of opaque types in a #[repr(C)] struct

Open GKFX opened this issue 1 year ago • 2 comments

Fixes #2845. Wrapping the generated array in a struct ensures that it is passed in an FFI-safe way. This does assume that the calling convention for structs is only dependent on size and alignment, but that seems like an improvement on using a type whose calling convention is not considered stable at all. Padding bytes (etc.) have been excluded from this treatment.

GKFX avatar Aug 08 '24 22:08 GKFX

@stevecapperarm does this resolve your issue in #2845?

r? @emilio @pvdrz

GKFX avatar Aug 09 '24 21:08 GKFX

Error: The feature assign is not enabled in this repository. To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

rustbot avatar Aug 09 '24 21:08 rustbot