mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-15 22:37:28 +02:00
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 https://github.com/rust-lang/rust/issues/41622 - this used to be a bug initially.
This commit is contained in:
parent
692e4b09c8
commit
a0bb5f30d0
@ -28,7 +28,7 @@ Typically because of interior mutability:
|
|||||||
|
|
||||||
These types are thread-safe, but they cannot be moved to another thread:
|
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.
|
thread which created them.
|
||||||
|
|
||||||
## `!Send + !Sync`
|
## `!Send + !Sync`
|
||||||
|
Loading…
Reference in New Issue
Block a user