Skip to content

Commit 69669cb

Browse files
committed
make IterMut Send/Sync again
1 parent e4c1a38 commit 69669cb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/alloc/src/collections/vec_deque.rs

+7
Original file line numberDiff line numberDiff line change
@@ -2694,6 +2694,13 @@ pub struct IterMut<'a, T: 'a> {
26942694
phantom: PhantomData<&'a mut [T]>,
26952695
}
26962696

2697+
// SAFETY: we do nothing thread-local and there is no interior mutability,
2698+
// so the usual structural `Send`/`Sync` apply.
2699+
#[stable(feature = "rust1", since = "1.0.0")]
2700+
unsafe impl<T: Send> Send for IterMut<'_, T> {}
2701+
#[stable(feature = "rust1", since = "1.0.0")]
2702+
unsafe impl<T: Sync> Sync for IterMut<'_, T> {}
2703+
26972704
#[stable(feature = "collection_debug", since = "1.17.0")]
26982705
impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {
26992706
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)