diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-28 10:13:28 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-28 10:13:28 +0200 |
| commit | 689835c00ec7b78f3c828e796895661c13584a64 (patch) | |
| tree | d06f65ecf1b9a36969ab05f0ce6479e90dc9125b /rust/pin-init/src/alloc.rs | |
| parent | c2d2c5c0d631f7de9697870e4eec89289177d445 (diff) | |
| parent | b4432656b36e5cc1d50a1f2dc15357543add530e (diff) | |
| download | linux-689835c00ec7b78f3c828e796895661c13584a64.tar.gz linux-689835c00ec7b78f3c828e796895661c13584a64.zip | |
Merge 6.15-rc4 into tty-next
We need the tty/serial 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 { |
