aboutsummaryrefslogtreecommitdiffstats
path: root/rust/pin-init/src/alloc.rs
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-05-05 13:25:15 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-05 13:25:15 +0800
commitfba4aafaba8a6ca2bb42e854c37ff9a685ddfd71 (patch)
tree4ba74ac925fc7d7b131fa54239b43c00a42a3429 /rust/pin-init/src/alloc.rs
parentcrypto: s390/sha512 - Fix sha512 state size (diff)
parentLinux 6.15-rc5 (diff)
downloadlinux-fba4aafaba8a6ca2bb42e854c37ff9a685ddfd71.tar.gz
linux-fba4aafaba8a6ca2bb42e854c37ff9a685ddfd71.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux v6.15-rc5
Merge mainline to pick up bcachefs poly1305 patch 4bf4b5046de0 ("bcachefs: use library APIs for ChaCha20 and Poly1305"). This is a prerequisite for removing the poly1305 shash algorithm.
Diffstat (limited to 'rust/pin-init/src/alloc.rs')
-rw-r--r--rust/pin-init/src/alloc.rs8
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 {