rust-lang / rust-bindgen

Automatically generates Rust FFI bindings to C (and some C++) libraries.
https://rust-lang.github.io/rust-bindgen/
BSD 3-Clause "New" or "Revised" License
4.39k stars 691 forks source link

Move phantom fields to start of struct to avoid interfering with flexible array members #2783

Closed jsgf closed 6 months ago

jsgf commented 6 months ago

PR #2772 adds support for representing C flexible array members as Rust DSTs, but these must always be the last field. This moves the PhantomData fields to the front of the structure so they're out of the way.

This is a noisy change as it updates a bunch of test fixtures, but should be a functional no-op.