pub struct SyncNoinit<T>(pub UnsafeCell<MaybeUninit<T>>);Expand description
A Sync wrapper around UnsafeCell<MaybeUninit<T>> for use with
#[link_section = ".uninit"] statics.
Rust 2024 made &mut static_mut a hard error (static_mut_refs lint).
UnsafeCell is the correct escape hatch: it opts into interior
mutability, so a raw pointer obtained via UnsafeCell::get() is not a
reference to a mutable static. The unsafe impl Sync is sound on a
single-core target where no thread can race on the cell.
Tuple Fields§
§0: UnsafeCell<MaybeUninit<T>>