]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: add `ZeroableOption` and implement it instead of `Zeroable` for `Option<Box...
authorBenno Lossin <benno.lossin@proton.me>
Sat, 8 Mar 2025 11:04:43 +0000 (11:04 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 16 Mar 2025 20:59:18 +0000 (21:59 +0100)
commit5657c3a9faf6c1243cecc9314244c92bfcd1ecad
tree8999fc069ff6d4bc3d1910edbc375a997110756b
parent9d29c682f00c3d8dd5727f6a350c4f6ecccc3913
rust: add `ZeroableOption` and implement it instead of `Zeroable` for `Option<Box<T, A>>`

When making pin-init its own crate, `Zeroable` will no longer be defined
by the kernel crate and thus implementing it for `Option<Box<T, A>>` is
no longer possible due to the orphan rule.
For this reason introduce a new `ZeroableOption` trait that circumvents
this problem.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Tested-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250308110339.2997091-11-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/alloc/kbox.rs
rust/pin-init/src/lib.rs