diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-28 09:45:00 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-28 09:45:00 +0200 |
| commit | 4f822ad5ee944ffafc21937a32dd055f1df5c28d (patch) | |
| tree | 9b38a39de453ec1694fb383a812639162d1182a0 /rust/pin-init/src/alloc.rs | |
| parent | rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() (diff) | |
| parent | Linux 6.15-rc4 (diff) | |
| download | linux-4f822ad5ee944ffafc21937a32dd055f1df5c28d.tar.gz linux-4f822ad5ee944ffafc21937a32dd055f1df5c28d.zip | |
Merge 6.15-rc4 into char-misc-next
We need the char-misc fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/pin-init/src/alloc.rs')
| -rw-r--r-- | rust/pin-init/src/alloc.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/rust/pin-init/src/alloc.rs b/rust/pin-init/src/alloc.rs index e16baa3b434e..5017f57442d8 100644 --- a/rust/pin-init/src/alloc.rs +++ b/rust/pin-init/src/alloc.rs @@ -17,11 +17,9 @@ use crate::{ pub extern crate alloc; -// SAFETY: All zeros is equivalent to `None` (option layout optimization guarantee). -// -// In this case we are allowed to use `T: ?Sized`, since all zeros is the `None` variant and there -// is no problem with a VTABLE pointer being null. -unsafe impl<T: ?Sized> ZeroableOption for Box<T> {} +// SAFETY: All zeros is equivalent to `None` (option layout optimization guarantee: +// <https://doc.rust-lang.org/stable/std/option/index.html#representation>). +unsafe impl<T> ZeroableOption for Box<T> {} /// Smart pointer that can initialize memory in-place. pub trait InPlaceInit<T>: Sized { |
