diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs index 429b485d8825..0e44b3cc2eed 100644 --- a/rust/kernel/init.rs +++ b/rust/kernel/init.rs @@ -202,11 +202,12 @@ use crate::{ error::{self, Error}, sync::UniqueArc, - types::ScopeGuard, + types::{Opaque, ScopeGuard}, }; use alloc::boxed::Box; use core::{ alloc::AllocError, + cell::UnsafeCell, convert::Infallible, marker::PhantomData, mem::MaybeUninit, @@ -1151,6 +1152,11 @@ impl_zeroable! { // SAFETY: Type is allowed to take any value, including all zeros. {} MaybeUninit, + // SAFETY: Type is allowed to take any value, including all zeros. + {} Opaque, + + // SAFETY: `T: Zeroable` and `UnsafeCell` is `repr(transparent)`. + {} UnsafeCell, // SAFETY: All zeros is equivalent to `None` (option layout optimization guarantee). Option, Option, Option, Option,