aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/rustdoc_test_builder.rs
diff options
context:
space:
mode:
authorBenno Lossin <[email protected]>2025-04-21 22:18:41 +0000
committerBenno Lossin <[email protected]>2025-05-01 16:15:12 +0000
commita313d41a2b515bbb76d56df490b731ff6d64e571 (patch)
tree90237af12938ddadd641be69df05ede96fb3c84a /scripts/rustdoc_test_builder.rs
parentrust: pin-init: allow `pub` fields in `derive(Zeroable)` (diff)
downloadkernel-a313d41a2b515bbb76d56df490b731ff6d64e571.tar.gz
kernel-a313d41a2b515bbb76d56df490b731ff6d64e571.zip
rust: pin-init: allow `Zeroable` derive macro to also be applied to unions
Enabling the same behavior for unions as for structs is correct, but could be relaxed: the valid bit patterns for unions are the union of all valid bit patterns of their fields. So for a union to implement `Zeroable`, only a single field needs to implement `Zeroable`. This can be a future improvement, as it is currently only needed for unions where all fields implement `Zeroable`. There is no danger for mis-parsing with the two optional tokens (ie neither one or both tokens are parsed), as the compiler will already have rejected that before giving it as the input to the derive macro. Link: https://github.com/Rust-for-Linux/pin-init/pull/42/commits/5927b497ce522d82f6c082d5ba9235df57bfdb32 Signed-off-by: Benno Lossin <[email protected]>
Diffstat (limited to 'scripts/rustdoc_test_builder.rs')
0 files changed, 0 insertions, 0 deletions