summaryrefslogtreecommitdiff
path: root/drivers/fpga/fpga-mgr.c
diff options
context:
space:
mode:
authorMiguel Ojeda <ojeda@kernel.org>2025-04-07 23:18:21 +0300
committerMiguel Ojeda <ojeda@kernel.org>2025-04-08 22:12:58 +0300
commit3c75fff196c35c3bbe8c212ad03db94994130b32 (patch)
tree514c144e26796918e43925b4f68699f7583ed00e /drivers/fpga/fpga-mgr.c
parent05a2b0011c4b6cbbc9b577f6abebe4e9333b0cf6 (diff)
downloadlinux-3c75fff196c35c3bbe8c212ad03db94994130b32.tar.xz
rust: pin-init: alloc: restrict `impl ZeroableOption` for `Box` to `T: Sized`
Similar to what was done for `Zeroable<NonNull<T>>` in commit df27cef15360 ("rust: init: fix `Zeroable` implementation for `Option<NonNull<T>>` and `Option<KBox<T>>`"), the latest Rust documentation [1] says it guarantees that `transmute::<_, Option<T>>([0u8; size_of::<T>()])` is sound and produces `Option::<T>::None` only in some cases. In particular, it says: `Box<U>` (specifically, only `Box<U, Global>`) when `U: Sized` Thus restrict the `impl` to `Sized`, and use similar wording as in that commit too. Link: https://doc.rust-lang.org/stable/std/option/index.html#representation [1] Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Link: https://github.com/Rust-for-Linux/pin-init/pull/32/commits/a6007cf555e5946bcbfafe93a6468c329078acd8 Fixes: 9b2299af3b92 ("rust: pin-init: add `std` and `alloc` support from the user-space version") Cc: stable@vger.kernel.org [ Adjust mentioned commit to the one from the kernel. - Benno ] Signed-off-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20250407201755.649153-2-benno.lossin@proton.me Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
0 files changed, 0 insertions, 0 deletions