mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
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: 1165cdad1a
Signed-off-by: Benno Lossin <benno.lossin@proton.me>