diff options
| author | Marcelo Diop-Gonzalez <marcelo827@gmail.com> | 2021-10-08 15:29:04 -0400 |
|---|---|---|
| committer | Marcelo Diop-Gonzalez <marcelo827@gmail.com> | 2021-10-08 15:29:04 -0400 |
| commit | 82c974dab5cd69862528724a36a954d9699b3d98 (patch) | |
| tree | f9ce44a293a50e262945de3c7c89a7f4107f8786 /library/std/src | |
| parent | 87df4dd70f13f248a4d2d22cdd96ee59d161d741 (diff) | |
Fix minor std::thread documentation typo
callers of spawn_unchecked() need to make sure that the thread not outlive references in the passed closure, not the other way around.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/thread/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 707a55b6258..7d404aff30e 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -412,9 +412,9 @@ impl Builder { /// /// # Safety /// - /// The caller has to ensure that no references in the supplied thread closure - /// or its return type can outlive the spawned thread's lifetime. This can be - /// guaranteed in two ways: + /// The caller has to ensure that the spawned thread does not outlive any + /// references in the supplied thread closure and its return type. + /// This can be guaranteed in two ways: /// /// - ensure that [`join`][`JoinHandle::join`] is called before any referenced /// data is dropped |
