From e23a9d34f256e51e0f7f6153e38da1f898623664 Mon Sep 17 00:00:00 2001 From: Fabian Bornhofen Date: Thu, 12 Oct 2023 21:09:31 +0200 Subject: [PATCH] Add trait bound to example for MutexGuard that is !Send + Sync 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. --- src/concurrency/send-sync/examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/concurrency/send-sync/examples.md b/src/concurrency/send-sync/examples.md index 8c8f92ad7b78..77f18b866527 100644 --- a/src/concurrency/send-sync/examples.md +++ b/src/concurrency/send-sync/examples.md @@ -28,7 +28,7 @@ Typically because of interior mutability: These types are thread-safe, but they cannot be moved to another thread: -* `MutexGuard`: Uses OS level primitives which must be deallocated on the +* `MutexGuard`: Uses OS level primitives which must be deallocated on the thread which created them. ## `!Send + !Sync`