diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-05-15 17:12:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-15 17:12:44 +0200 |
| commit | c93c2985d88dc7fc2c4444096f81e522aa3ea876 (patch) | |
| tree | 943a181fd13d63c0cfe3de335b9cccb4b049d2d3 /library/std/src | |
| parent | 1063548a1a2ff954087eeeb8b6598c28cafa1e22 (diff) | |
| parent | 2563fbeab31def56b66cbdebd7bb0b7e5efbecb8 (diff) | |
| download | rust-c93c2985d88dc7fc2c4444096f81e522aa3ea876.tar.gz rust-c93c2985d88dc7fc2c4444096f81e522aa3ea876.zip | |
Rollup merge of #110049 - SkiFire13:localkey-with-docs-fix, r=workingjubilee
Don't claim `LocalKey::with` prevents a reference to be sent across threads The documentation for `LocalKey` claims that `with` yields a reference that cannot be sent across threads, but this is false since you can easily do that with scoped threads. What it actually prevents is the reference from outliving the current thread.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/thread/local.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 3b7c31826b9..1b86d898cc7 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -18,8 +18,8 @@ use crate::fmt; /// target platform. It is instantiated with the [`thread_local!`] macro and the /// primary method is the [`with`] method. /// -/// The [`with`] method yields a reference to the contained value which cannot be -/// sent across threads or escape the given closure. +/// The [`with`] method yields a reference to the contained value which cannot +/// outlive the current thread or escape the given closure. /// /// [`thread_local!`]: crate::thread_local /// |
