about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/array/iter.rs10
-rw-r--r--library/core/src/iter/adapters/array_chunks.rs7
2 files changed, 4 insertions, 13 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs
index 459cd094cdc..f4885ed9ffb 100644
--- a/library/core/src/array/iter.rs
+++ b/library/core/src/array/iter.rs
@@ -84,16 +84,6 @@ impl<T, const N: usize> IntoIter<T, N> {
         IntoIterator::into_iter(array)
     }
 
-    /// Creates a new iterator from a partially initalized array.
-    ///
-    /// # Safety
-    ///
-    /// The caller must guarantee that all and only the `alive` elements of
-    /// `data` are initialized.
-    pub(crate) unsafe fn with_partial(data: [MaybeUninit<T>; N], alive: Range<usize>) -> Self {
-        Self { data, alive }
-    }
-
     /// Creates an iterator over the elements in a partially-initialized buffer.
     ///
     /// If you have a fully-initialized array, then use [`IntoIterator`].
diff --git a/library/core/src/iter/adapters/array_chunks.rs b/library/core/src/iter/adapters/array_chunks.rs
index 2ec1284c394..8f3e1b58b52 100644
--- a/library/core/src/iter/adapters/array_chunks.rs
+++ b/library/core/src/iter/adapters/array_chunks.rs
@@ -64,7 +64,7 @@ where
                         mem::forget(guard);
                         self.remainder = {
                             // SAFETY: `array` was initialized with `init` elements.
-                            Some(unsafe { array::IntoIter::with_partial(array, 0..init) })
+                            Some(unsafe { array::IntoIter::new_unchecked(array, 0..init) })
                         };
                     }
                     return None;
@@ -124,7 +124,8 @@ where
                     let init = guard.init;
                     mem::forget(guard);
                     // SAFETY: `array` was initialized with `init` elements.
-                    self.remainder = Some(unsafe { array::IntoIter::with_partial(array, 0..init) });
+                    self.remainder =
+                        Some(unsafe { array::IntoIter::new_unchecked(array, 0..init) });
                 }
                 R::from_output(o)
             }
@@ -305,7 +306,7 @@ where
         // SAFETY: `array` was initialized with exactly `init` elements.
         self.remainder = unsafe {
             array.get_unchecked_mut(..init).reverse();
-            Some(array::IntoIter::with_partial(array, 0..init))
+            Some(array::IntoIter::new_unchecked(array, 0..init))
         };
         Some(())
     }