mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
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:
parent
87df4dd70f
commit
82c974dab5
@ -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