diff --git a/src/lib.rs b/src/lib.rs index 83149ac..c2061f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -454,7 +454,10 @@ pub mod unsync { /// Returns `None` if the cell is empty. #[inline] pub fn get(&self) -> Option<&T> { - // Safe due to `inner`'s invariant + // Safe due to `inner`'s invariant of being written to at most once. + // Had multiple writes to `inner` been allowed, a reference to the + // value we return now would become dangling by a write of a + // different value later. unsafe { &*self.inner.get() }.as_ref() }