Skip to content

Commit

Permalink
make IterMut Send/Sync again
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Oct 5, 2020
1 parent e4c1a38 commit 69669cb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/alloc/src/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 69669cb

Please sign in to comment.