Skip to content

Commit 1289db6

Browse files
authored
Impl Send/Sync for IntoIter (#368)
Closes #367.
1 parent a176a87 commit 1289db6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,11 @@ pub struct IntoIter<T, const N: usize> {
500500
_marker: PhantomData<T>,
501501
}
502502

503+
// SAFETY: IntoIter has unique ownership of its contents. Sending (or sharing) an `IntoIter<T, N>`
504+
// is equivalent to sending (or sharing) a `SmallVec<T, N>`.
505+
unsafe impl<T, const N: usize> Send for IntoIter<T, N> where T: Send {}
506+
unsafe impl<T, const N: usize> Sync for IntoIter<T, N> where T: Sync {}
507+
503508
impl<T, const N: usize> IntoIter<T, N> {
504509
#[inline]
505510
const fn is_zst() -> bool {

0 commit comments

Comments
 (0)