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
Bindgen currently emits unit tests to check layout. However, these are quite difficult to run for a cross-compiled target as there may be no way to run code on the target as part of the build process. Targets not supporting std, i.e. embedded, are harder again to run the tests on.
With the stabilization of core::mem::offset_of it should now be possible to convert the layout tests into compile-time assertions like below. This would make it much easier for embedded users to run these tests.
Biggest change change introduced in 0.70 is the compile-time
layout tests to to check and validate layouts. Previously these
tests were implemented as unit tests which made it somewhat
difficult to run on cross-compiled targets.
More info:
* rust-lang/rust-bindgen#2786
* rust-lang/rust-bindgen#2787
plaes
added a commit
to plaes/nrf-sdc
that referenced
this issue
Oct 22, 2024
Biggest change change introduced in bindgen 0.70 is the compile-time
layout tests to to check and validate layouts. Previously these
tests were implemented as unit tests which made it somewhat
difficult to run on cross-compiled targets.
Also, drop `rustfmt_bindings()` call had been enabled by default for
a while and was removed/deprecated in bindgen 0.65.x releases.
More info:
* rust-lang/rust-bindgen#2786
* rust-lang/rust-bindgen#2787
Bindgen currently emits unit tests to check layout. However, these are quite difficult to run for a cross-compiled target as there may be no way to run code on the target as part of the build process. Targets not supporting
std
, i.e. embedded, are harder again to run the tests on.With the stabilization of
core::mem::offset_of
it should now be possible to convert the layout tests into compile-time assertions like below. This would make it much easier for embedded users to run these tests.The text was updated successfully, but these errors were encountered: