Skip to content

Commit e56fcbc

Browse files
committed
Remove reference to NoSend in concurrency chapter of the book
Fixes #23052
1 parent b2f09c1 commit e56fcbc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/doc/trpl/concurrency.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,8 @@ method which has this signature:
223223
fn lock(&self) -> LockResult<MutexGuard<T>>
224224
```
225225

226-
If we [look at the code for MutexGuard](https://github.com/rust-lang/rust/blob/ca4b9674c26c1de07a2042cb68e6a062d7184cef/src/libstd/sync/mutex.rs#L172), we'll see
227-
this:
228-
229-
```ignore
230-
__marker: marker::NoSend,
231-
```
232-
233-
Because our guard is `NoSend`, it's not `Send`. Which means we can't actually
234-
transfer the guard across thread boundaries, which gives us our error.
226+
Because `Send` is not implemented for `MutexGuard<T>`, we can't transfer the
227+
guard across thread boundaries, which gives us our error.
235228

236229
We can use `Arc<T>` to fix this. Here's the working version:
237230

0 commit comments

Comments
 (0)