rust/library/std
Mahmoud Al-Qudsi 65dffc1990 Change pedantically incorrect OnceCell/OnceLock wording
While the semantic intent of a OnceCell/OnceLock is that it can only be written
to once (upon init), the fact of the matter is that both these types offer a
`take(&mut self) -> Option<T>` mechanism that, when successful, resets the cell
to its initial state, thereby technically allowing it to be written to again.

Despite the fact that this can only happen with a mutable reference (generally
only used during the construction of the OnceCell/OnceLock), it would be
incorrect to say that the type itself as a whole categorically prevents being
initialized or written to more than once (since it is possible to imagine an
identical type only without the `take()` method that actually fulfills that
contract).

To clarify, change "that cannot be.." to "that nominally cannot.." and add a
note to OnceCell about what can be done with an `&mut Self` reference.
2024-05-24 12:15:06 -05:00
..
benches also test parts of std 2024-04-07 10:05:57 +02:00
src Change pedantically incorrect OnceCell/OnceLock wording 2024-05-24 12:15:06 -05:00
tests Rename test for issue 21058 2024-05-05 10:47:12 -04:00
build.rs Move some expected cfgs to std build.rs as per Cargo recommandation 2024-05-23 16:08:31 +02:00
Cargo.toml Copy core/alloc check-cfg message also in std 2024-05-23 16:08:34 +02:00