diff options
| author | Benno Lossin <[email protected]> | 2025-04-21 22:18:52 +0000 |
|---|---|---|
| committer | Benno Lossin <[email protected]> | 2025-05-01 16:15:26 +0000 |
| commit | 00fccd3ecc2129ee32fd181079eb643f497044c4 (patch) | |
| tree | 1557f9b7fe9329067606344d6b40ded549150b24 /scripts/rustdoc_test_builder.rs | |
| parent | rust: pin-init: allow `Zeroable` derive macro to also be applied to unions (diff) | |
| download | kernel-00fccd3ecc2129ee32fd181079eb643f497044c4.tar.gz kernel-00fccd3ecc2129ee32fd181079eb643f497044c4.zip | |
rust: pin-init: add `MaybeZeroable` derive macro
This derive macro implements `Zeroable` for structs & unions precisely
if all fields also implement `Zeroable` and does nothing otherwise. The
plain `Zeroable` derive macro instead errors when it cannot derive
`Zeroable` safely. The `MaybeZeroable` derive macro is useful in cases
where manual checking is infeasible such as with the bindings crate.
Move the zeroable generics parsing into a standalone function in order
to avoid code duplication between the two derive macros.
Link: https://github.com/Rust-for-Linux/pin-init/pull/42/commits/1165cdad1a391b923efaf30cf76bc61e38da022e
Signed-off-by: Benno Lossin <[email protected]>
Diffstat (limited to 'scripts/rustdoc_test_builder.rs')
0 files changed, 0 insertions, 0 deletions
