mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
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.
This commit is contained in:
commit
c93c2985d8
@ -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
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user