rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments
authorBenno Lossin <lossin@kernel.org>
Fri, 23 May 2025 14:51:02 +0000 (16:51 +0200)
committerBenno Lossin <lossin@kernel.org>
Wed, 11 Jun 2025 19:13:57 +0000 (21:13 +0200)
commitec87ec35ca8bd61bfc1200224d332b4573b9dafa
tree03b481f0cb9bef8216c02d2b801e197ebbe33a46
parent9f473538706b9fb5e82c9864b04089d35e4f93d5
rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments

`Option<[unsafe] [extern "abi"] fn(...args...) -> ret>` is documented
[1] to also have the `None` variant equal all zeroes.

Link: https://doc.rust-lang.org/stable/std/option/index.html#representation
Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/b6c1ab4fb3699765f81ae512ecac5a2f032d8d51
Link: https://lore.kernel.org/all/20250523145125.523275-7-lossin@kernel.org
Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/pin-init/src/lib.rs