diff options
author | Benno Lossin <benno.lossin@proton.me> | 2025-04-21 22:18:41 +0000 |
---|---|---|
committer | Benno Lossin <benno.lossin@proton.me> | 2025-05-01 18:15:12 +0200 |
commit | a313d41a2b515bbb76d56df490b731ff6d64e571 (patch) | |
tree | 90237af12938ddadd641be69df05ede96fb3c84a /scripts/generate_rust_analyzer.py | |
parent | 983d13fc2cf12f0a753700d48be7d04155a1272c (diff) |
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 <benno.lossin@proton.me>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions