rust/library
Matthias Krüger 55f7571a7e
Rollup merge of #140715 - lukaslueg:oncecellsyncdocs, r=tgross35
Clarify &mut-methods' docs on sync::OnceLock

Three small changes to the docs of `sync::OnceLock`:

* The docs for `OnceLock::take()` used to [say](https://doc.rust-lang.org/std/sync/struct.OnceLock.html#method.take) "**Safety** is guaranteed by requiring a mutable reference." (emphasis mine). While technically correct, imho its not necessary to even mention safety - as opposed to unsafety - here: Safety never comes up wrt `OnceLock`, as there is (currently) no way to interact with a `OnceLock` in an unsafe way; there are no unsafe methods on `OnceLock`, so there is "safety" guarantee required anywhere. What we simply meant to say is "**Synchronization** is guaranteed...".
* I've add that phrase to the other methods of `OnceLock` which take a `&mut self`, to highlight the fact that having a `&mut OnceLock` guarantees that synchronization with other threads is not required. This is the same as with [`Mutex::get_mut()`](https://doc.rust-lang.org/std/sync/struct.Mutex.html#method.get_mut), [`Cell::get_mut()`](https://doc.rust-lang.org/std/cell/struct.Cell.html#method.get_mut), and others.
* In that spirit, the half-sentence "or being initialized" was removed from `get_mut()`, as there is no way that the `OnceLock` is being initialized while we are holding `&mut` to it. Probably a copy&paste from `.get()`
2025-06-03 07:03:42 +02:00
..
alloc Rollup merge of #141805 - tgross35:update-builtins, r=tgross35 2025-05-31 18:51:50 +02:00
alloctests Update tests with Range parameter to BTreeMap::extract_if etc. 2025-05-27 08:31:56 -07:00
backtrace@6c882eb119 Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
core Rollup merge of #141874 - usamoi:eps, r=tgross35 2025-06-02 15:19:19 +02:00
coretests Add const support for float rounding methods 2025-05-31 15:26:57 -03:00
panic_abort deduplicate abort implementations 2025-05-15 11:20:13 +02:00
panic_unwind deduplicate abort implementations 2025-05-15 11:20:13 +02:00
portable-simd Merge commit 'c14f2fc3eb' into sync-from-portable-simd-2025-03-19 2025-03-19 00:58:47 -04:00
proc_macro Do not get proc_macro from the sysroot in rustc 2025-05-27 15:49:28 +00:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Revert changes for rtstartup 2025-03-10 21:23:31 +08:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std Rollup merge of #140715 - lukaslueg:oncecellsyncdocs, r=tgross35 2025-06-03 07:03:42 +02:00
stdarch@b6e2249e38 bump stdarch 2025-05-21 13:41:58 +02:00
sysroot Update stdarch 2025-05-01 20:01:43 +05:30
test Add new test_main_with_exit_callback public function in libtest to allow a callback to be called before exiting 2025-05-06 18:17:48 +02:00
unwind unwind: bump unwinding dependency to 0.2.6 2025-04-29 09:46:32 +08:00
windows_targets Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
Cargo.lock Update compiler-builtins to 0.1.160 2025-05-30 16:09:12 +00:00
Cargo.toml Add opt-level = "s" for more std symbolication crates 2025-04-01 20:50:19 +00:00