Skip to content

Commit

Permalink
Add trait bound to example for MutexGuard that is !Send + Sync
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fbornhofen committed Oct 12, 2023
1 parent 358d7da commit e23a9d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/concurrency/send-sync/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Typically because of interior mutability:

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

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

## `!Send + !Sync`
Expand Down

0 comments on commit e23a9d3

Please sign in to comment.