1#![allow(missing_docs)]
2
3use crate::void;
4use core::cell::UnsafeCell;
5use core::marker::{PhantomData, PhantomPinned};
6use core::mem;
7use core::panic::RefUnwindSafe;
8
9#[repr(C, packed)]
18pub struct Opaque {
19 _private: [*const void; 0],
20 _pinned: PhantomData<PhantomPinned>,
21 _mutable: SyncUnsafeCell<PhantomData<()>>,
22}
23
24impl RefUnwindSafe for Opaque {}
25
26#[repr(transparent)]
28struct SyncUnsafeCell<T>(UnsafeCell<T>);
29
30unsafe impl<T> Sync for SyncUnsafeCell<T> {}
31
32const_assert_eq!(0, mem::size_of::<Opaque>());
33const_assert_eq!(1, mem::align_of::<Opaque>());