]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: pin-init: extend `impl_zeroable_option` macro to handle generics
authorMohamad Alsadhan <mo@sdhn.cc>
Tue, 28 Apr 2026 13:10:53 +0000 (14:10 +0100)
committerGary Guo <gary@garyguo.net>
Sun, 10 May 2026 21:58:33 +0000 (22:58 +0100)
commitde54c2cb052952df2a6f91617471d1f02f213d4e
treef93cca091dc01529b863d754dc122a808cd41502
parent04828a538da2bed3150116929306f849a3337a37
rust: pin-init: extend `impl_zeroable_option` macro to handle generics

Improve impl_zeroable_option macro to handle generic impls for types
like `&T`, `&mut T`, `NonNull<T>`, and others (for which `Option<T>`
is guaranteed to be zeroable) with similar approach to
`impl_zeroable`.

Also, update old declarations to use generics e.g. `NonZeroU8` to
`NonZero<u8>`.

Signed-off-by: Mohamad Alsadhan <mo@sdhn.cc>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260428-pin-init-sync-v1-4-07f9bd3859fb@garyguo.net
Signed-off-by: Gary Guo <gary@garyguo.net>
rust/pin-init/src/lib.rs