rust: pin-init: implement `ZeroableOption` for `&T` and `&mut T`
authorBenno Lossin <lossin@kernel.org>
Fri, 23 May 2025 14:51:00 +0000 (16:51 +0200)
committerBenno Lossin <lossin@kernel.org>
Wed, 11 Jun 2025 19:13:56 +0000 (21:13 +0200)
commite93a238605348bc40fed77ba5582e311376d113b
tree08baf0c1e16fa34f184eb38135905e5d838b56ff
parentd67b37012080cf1978b5fd36f040a53f92152243
rust: pin-init: implement `ZeroableOption` for `&T` and `&mut T`

`Option<&T>` and `Option<&mut T>` are documented [1] to have the `None`
variant be 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/5ef1638c79e019d3dc0c62db5905601644c2e60a
Link: https://lore.kernel.org/all/20250523145125.523275-5-lossin@kernel.org
Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/pin-init/src/lib.rs