Skip to content

Commit ef72349

Browse files
committed
Remove array::IntoIter::with_partial -- an artifact of the past, once used to create an IntoIter from its parts
1 parent f548518 commit ef72349

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

library/core/src/array/iter.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,6 @@ impl<T, const N: usize> IntoIter<T, N> {
8484
IntoIterator::into_iter(array)
8585
}
8686

87-
/// Creates a new iterator from a partially initalized array.
88-
///
89-
/// # Safety
90-
///
91-
/// The caller must guarantee that all and only the `alive` elements of
92-
/// `data` are initialized.
93-
pub(crate) unsafe fn with_partial(data: [MaybeUninit<T>; N], alive: Range<usize>) -> Self {
94-
Self { data, alive }
95-
}
96-
9787
/// Creates an iterator over the elements in a partially-initialized buffer.
9888
///
9989
/// If you have a fully-initialized array, then use [`IntoIterator`].

library/core/src/iter/adapters/array_chunks.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ where
6464
mem::forget(guard);
6565
self.remainder = {
6666
// SAFETY: `array` was initialized with `init` elements.
67-
Some(unsafe { array::IntoIter::with_partial(array, 0..init) })
67+
Some(unsafe { array::IntoIter::new_unchecked(array, 0..init) })
6868
};
6969
}
7070
return None;
@@ -124,7 +124,8 @@ where
124124
let init = guard.init;
125125
mem::forget(guard);
126126
// SAFETY: `array` was initialized with `init` elements.
127-
self.remainder = Some(unsafe { array::IntoIter::with_partial(array, 0..init) });
127+
self.remainder =
128+
Some(unsafe { array::IntoIter::new_unchecked(array, 0..init) });
128129
}
129130
R::from_output(o)
130131
}
@@ -305,7 +306,7 @@ where
305306
// SAFETY: `array` was initialized with exactly `init` elements.
306307
self.remainder = unsafe {
307308
array.get_unchecked_mut(..init).reverse();
308-
Some(array::IntoIter::with_partial(array, 0..init))
309+
Some(array::IntoIter::new_unchecked(array, 0..init))
309310
};
310311
Some(())
311312
}

0 commit comments

Comments
 (0)