either_slot/
include_core.rs1pub use alloc::alloc::{handle_alloc_error, Global};
2pub use core::{
3 alloc::{Allocator, Layout},
4 hint,
5 mem::{self, ManuallyDrop},
6 ptr::NonNull,
7 sync::atomic::{self, AtomicBool, AtomicU8, AtomicUsize, Ordering::*},
8};
9
10#[derive(Debug)]
11pub(crate) struct UnsafeCell<T: ?Sized>(core::cell::UnsafeCell<T>);
12
13impl<T> UnsafeCell<T> {
14 pub(crate) const fn new(data: T) -> UnsafeCell<T> {
15 UnsafeCell(core::cell::UnsafeCell::new(data))
16 }
17
18 pub(crate) fn with_mut<R>(&self, f: impl FnOnce(*mut T) -> R) -> R {
19 f(self.0.get())
20 }
21}