mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
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.
This commit is contained in:
commit
346f833c3d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user