diff options
| author | Ralf Jung <post@ralfj.de> | 2020-09-19 11:55:45 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-10-05 09:12:56 +0200 |
| commit | 69669cbdb2a98bcf8c49062b9606e14ce51ecf71 (patch) | |
| tree | a93093d49958168c047d9f87cf0db3587e98157a | |
| parent | e4c1a3867f6380f4e0fe48119306ae5b56d74470 (diff) | |
| download | rust-69669cbdb2a98bcf8c49062b9606e14ce51ecf71.tar.gz rust-69669cbdb2a98bcf8c49062b9606e14ce51ecf71.zip | |
make IterMut Send/Sync again
| -rw-r--r-- | library/alloc/src/collections/vec_deque.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/library/alloc/src/collections/vec_deque.rs b/library/alloc/src/collections/vec_deque.rs index 0f34786b18a..e8e9dae0111 100644 --- a/library/alloc/src/collections/vec_deque.rs +++ b/library/alloc/src/collections/vec_deque.rs @@ -2694,6 +2694,13 @@ pub struct IterMut<'a, T: 'a> { phantom: PhantomData<&'a mut [T]>, } +// SAFETY: we do nothing thread-local and there is no interior mutability, +// so the usual structural `Send`/`Sync` apply. +#[stable(feature = "rust1", since = "1.0.0")] +unsafe impl<T: Send> Send for IterMut<'_, T> {} +#[stable(feature = "rust1", since = "1.0.0")] +unsafe impl<T: Sync> Sync for IterMut<'_, T> {} + #[stable(feature = "collection_debug", since = "1.17.0")] impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
