const _: () = assert!(std::mem::size_of::<Option<StablePointer<usize>>>() == std::mem::size_of::<usize>());
/// The caller must ensure that the pointer is valid and points to a valid T that outlives the StablePointer.
pub unsafe fn from_related_ptr<U: ?Sized>(ptr: NonNull<U>, #[allow(unused)] source: &Self) -> StablePointer<U> {
/// The caller must ensure the pointer points to a valid T that outlives the returned StablePointer.
/// In particular the element must not be removed from the owning [`StablePointerSet`] (nor the set
/// dropped) while the copy is alive, since [`Deref`] dereferences the pointer without any check.
/// Elements are stored in stable memory locations using a custom allocator, with the hash set maintaining references.
/// The set can use a custom hasher type for potentially better performance based on workload characteristics.
/// Creates an empty StablePointerSet with the specified capacity, default hasher, and global allocator.
/// Creates an empty StablePointerSet with the specified capacity, hasher, and global allocator.
/// Creates an empty StablePointerSet with the specified capacity, allocator, and default hasher.
/// Searches for a value equal to the provided reference and returns a pointer to the stored element.
// Add the result to the storage, it could be at this point that the entry was inserted by another thread. So
// this insertion might actually fail, in which case we should clean up the created entry and return the old pointer.
// TODO: I suppose this can go wrong with begin_insert(x); insert(x); remove(x); end_insert(x) chain.