Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#52759 - stjepang:impl-send-sync-for-joinhan…
…dle, r=TimNN Impl Send & Sync for JoinHandle This is just a cosmetic change - it slightly relaxes and clarifies the public API without effectively promising any new guarantees. Currently we have [these auto trait implementations](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#synthetic-implementations): ```rust impl<T: Send> Send for JoinHandle<T> {} impl<T: Sync> Sync for JoinHandle<T> {} ``` Bound `T: Send` doesn't make much sense because `JoinHandle<T>` can be created only when `T: Send`. Note that [`JoinHandle::<T>::join`](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#method.join) doesn't require `T: Send` so why should the `Send` impl? And the `Sync` impl doesn't need `T: Sync` because `JoinHandle<T>` cannot even share `T` - it can only send it to the thread that calls `join`.
- Loading branch information