diff --git a/src/lib.rs b/src/lib.rs index e2c608f..6f40c0f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,24 @@ use std::{ }; /// Owned cell for data. +/// +/// The data structure is not thread safe. +/// It is not even safe to move to another thread. +/// (i.e., !Send). +/// ```compile_fail,E0433 +/// use std::sync::atomic::AtomicUsize; +/// +/// fn impl_send(val: T) {} +/// impl_send(LinkNode::new(AtomicUsize::new(0))); +/// ``` +/// +/// Nor sync: +/// ```compile_fail,E0433 +/// use std::sync::atomic::AtomicUsize; +/// +/// fn impl_sync(val: T) {} +/// impl_sync(LinkNode::new(AtomicUsize::new(0))); +/// ``` pub struct LinkNode(Pin>>); /// Pinned on heap for linking.