From 77a60d4101aa81dfcbc163a25a015459f3ccef42 Mon Sep 17 00:00:00 2001 From: Igor Petruk Date: Mon, 23 Jan 2023 07:51:41 +0000 Subject: [PATCH] Update send-sync.md (#258) Adding notes that these traits are not to be implemented directly. Yet they are still to be used as normal traits in generic constraints. --- src/concurrency/send-sync.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/concurrency/send-sync.md b/src/concurrency/send-sync.md index 4b6fa237..b179e6b2 100644 --- a/src/concurrency/send-sync.md +++ b/src/concurrency/send-sync.md @@ -7,5 +7,16 @@ How does Rust know to forbid shared access across thread? The answer is in two t * [`Sync`][2]: a type `T` is `Sync` if it is safe to move a `&T` across a thread boundary. +Both traits are not to be implemented. They are implemented automatically when +the compiler determines it’s appropriate. + [1]: https://doc.rust-lang.org/std/marker/trait.Send.html [2]: https://doc.rust-lang.org/std/marker/trait.Sync.html + +
+ +* One can think of these traits as markers that the type has certain + thread-safety properties. +* They can be used in the generic constraints as normal traits. + +