Skip to content

Commit a0bb5f3

Browse files
authored
Add trait bound to example for MutexGuard that is !Send + Sync (#1358)
This example only makes sense (and is therefore easier to understand logically :) ) if T is Sync. See rust-lang/rust#41622 - this used to be a bug initially.
1 parent 692e4b0 commit a0bb5f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/concurrency/send-sync/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Typically because of interior mutability:
2828

2929
These types are thread-safe, but they cannot be moved to another thread:
3030

31-
* `MutexGuard<T>`: Uses OS level primitives which must be deallocated on the
31+
* `MutexGuard<T: Sync>`: Uses OS level primitives which must be deallocated on the
3232
thread which created them.
3333

3434
## `!Send + !Sync`

0 commit comments

Comments
 (0)