Rust 1.77 toolchain - Fix alignment and layout for z_owned_reply_t #295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rust 1.77 has been released: https://releases.rs/docs/1.77.0/
Along with 1.77 it comes the following change: rust-lang/rust#116672
This means that
u128
have now a different alignment onx86
targets, making the compilation of zenoh-c to fail onx86
when compiled with Rust1.77
.This patch fixes the memory layout and alignment of the
z_owned_reply_t
affected by that change.However, I suggest to not merge this PR straight away since there are projects that depend on
main
branch of zenoh-c and they will not use Rust 1.77. E.g.: https://github.com/ros2/rmw_zenoh will use the Rust shipped version in Ubuntu 24.04, which is1.75
.An option could be to have different layout depending on the compiler version but this capability seems to be still unstable: https://doc.rust-lang.org/unstable-book/language-features/cfg-version.html
A larger change may be hence needed in Zenoh, particularly in the
ZenohId
type to avoid usingu128
at all.