1
0
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:
Fabian Bornhofen 2023-10-12 22:29:37 +02:00 committed by GitHub
parent 692e4b09c8
commit a0bb5f30d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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`