Skip to content

Commit 346f833

Browse files
authored
Rollup merge of #89678 - marcelo-gonzalez:master, r=joshtriplett
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.
2 parents 5ebb6a8 + 82c974d commit 346f833

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/thread/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ impl Builder {
412412
///
413413
/// # Safety
414414
///
415-
/// The caller has to ensure that no references in the supplied thread closure
416-
/// or its return type can outlive the spawned thread's lifetime. This can be
417-
/// guaranteed in two ways:
415+
/// The caller has to ensure that the spawned thread does not outlive any
416+
/// references in the supplied thread closure and its return type.
417+
/// This can be guaranteed in two ways:
418418
///
419419
/// - ensure that [`join`][`JoinHandle::join`] is called before any referenced
420420
/// data is dropped

0 commit comments

Comments
 (0)