Skip to content

Commit 77a60d4

Browse files
authored
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.
1 parent 905d0a0 commit 77a60d4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/concurrency/send-sync.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,16 @@ How does Rust know to forbid shared access across thread? The answer is in two t
77
* [`Sync`][2]: a type `T` is `Sync` if it is safe to move a `&T` across a thread
88
boundary.
99

10+
Both traits are not to be implemented. They are implemented automatically when
11+
the compiler determines it’s appropriate.
12+
1013
[1]: https://doc.rust-lang.org/std/marker/trait.Send.html
1114
[2]: https://doc.rust-lang.org/std/marker/trait.Sync.html
15+
16+
<details>
17+
18+
* One can think of these traits as markers that the type has certain
19+
thread-safety properties.
20+
* They can be used in the generic constraints as normal traits.
21+
22+
</details>

0 commit comments

Comments
 (0)