mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-14 22:15:54 +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:
|
||||
|
||||
* `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`
|
||||
|
Loading…
Reference in New Issue
Block a user