Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grounded"
version = "0.2.0"
version = "0.2.1"
authors = ["James Munns <james@onevariable.com>"]
edition = "2021"
readme = "README.md"
Expand Down
7 changes: 4 additions & 3 deletions src/uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ use crate::const_init::ConstInit;
/// This type may be used to provide inner mutability, when accessed through the
/// [GroundedCell::get()] interface.
///
/// [GroundedCell] is also `#[repr(transparent)], as are `UnsafeCell` and `MaybeUninit`,
/// [GroundedCell] is also `#[repr(transparent)]`, as are `UnsafeCell` and `MaybeUninit`,
/// which means that it will have the same layout and alignment as `T`.
#[repr(transparent)]
pub struct GroundedCell<T> {
inner: UnsafeCell<MaybeUninit<T>>,
}

unsafe impl<T: Sync> Sync for GroundedCell<T> {}
unsafe impl<T> Sync for GroundedCell<T> {}
unsafe impl<T: Send> Send for GroundedCell<T> {}

impl<T: ConstInit> GroundedCell<T> {
/// Create a new GroundedCell with the cell initialized with
Expand Down Expand Up @@ -95,7 +96,7 @@ impl<T> GroundedCell<T> {
/// This type may be used to provide inner mutability, when accessed through the
/// [GroundedArrayCell::get_ptr_len()] interface.
///
/// [GroundedArrayCell] is also `#[repr(transparent)], as are `UnsafeCell` and `MaybeUninit`,
/// [GroundedArrayCell] is also `#[repr(transparent)]`, as are `UnsafeCell` and `MaybeUninit`,
/// which means that it will have the same layout and alignment as `[T; N]`.
#[repr(transparent)]
pub struct GroundedArrayCell<T, const N: usize> {
Expand Down