Change pedantically incorrect OnceCell/OnceLock wording · model-checking/verify-rust-std@749b376 (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -2,12 +2,12 @@ use crate::cell::UnsafeCell;
2 2 use crate::fmt;
3 3 use crate::mem;
4 4
5 -/// A cell which can be written to only once.
5 +/// A cell which can nominally be written to only once.
6 6 ///
7 7 /// This allows obtaining a shared `&T` reference to its inner value without copying or replacing
8 8 /// it (unlike [`Cell`]), and without runtime borrow checks (unlike [`RefCell`]). However,
9 9 /// only immutable references can be obtained unless one has a mutable reference to the cell
10 -/// itself.
10 +/// itself. In the same vein, the cell can only be re-initialized with such a mutable reference.
11 11 ///
12 12 /// For a thread-safe version of this struct, see [`std::sync::OnceLock`].
13 13 ///
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ use crate::mem::MaybeUninit;
5 5 use crate::panic::{RefUnwindSafe, UnwindSafe};
6 6 use crate::sync::Once;
7 7
8 -/// A synchronization primitive which can be written to only once.
8 +/// A synchronization primitive which can nominally be written to only once.
9 9 ///
10 10 /// This type is a thread-safe [`OnceCell`], and can be used in statics.
11 11 ///