Description
As far as I can tell, there is no documentation outside of the Rustonomicon that says that Send
and Sync
are automatically derived on datatypes that consist solely of Send
and Sync
members, and that all primitives other than raw pointers are Send + Sync
.
So it is a natural worry for newcomers that the language is less thread-usable than it is (i.e., that libraries will forget to manually implement Send + Sync
, and be pathologically safe by being unusable across threads), and it's hard to clarify that. (I only found this part of the 'nomicon through git grep
; the obvious Google results for 'rust send and sync' didn't have a clear statement that they were automatically derived.)
This might be as easy as copying the two 'nomicon paragraphs starting with "Send and Sync are also automatically derived traits" into concurrency.md or so; there's no nontrivial discussion of unsafety in them. I could also send in a PR adding an example of using a Send + Sync
struct, if that would be helpful.