Skip to content

Commit

Permalink
s/from_raw_parts/new_unchecked/
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Dec 7, 2021
1 parent 0b90204 commit 9b86c59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/array/iter.rs
Expand Up @@ -126,7 +126,7 @@ impl<T, const N: usize> IntoIter<T, N> {
/// None => {
/// // SAFETY: We've initialized the first `i` items
/// unsafe {
/// return Err(IntoIter::from_raw_parts(buffer, 0..i));
/// return Err(IntoIter::new_unchecked(buffer, 0..i));
/// }
/// }
/// }
Expand All @@ -143,7 +143,7 @@ impl<T, const N: usize> IntoIter<T, N> {
/// ```
#[unstable(feature = "array_into_iter_constructors", issue = "91583")]
#[rustc_const_unstable(feature = "const_array_into_iter_constructors", issue = "91583")]
pub const unsafe fn from_raw_parts(
pub const unsafe fn new_unchecked(
buffer: [MaybeUninit<T>; N],
initialized: Range<usize>,
) -> Self {
Expand Down Expand Up @@ -210,7 +210,7 @@ impl<T, const N: usize> IntoIter<T, N> {

// SAFETY: We're telling it that none of the elements are initialized,
// which is trivially true. And ∀N: usize, 0 <= N.
unsafe { Self::from_raw_parts(buffer, initialized) }
unsafe { Self::new_unchecked(buffer, initialized) }
}

/// Returns an immutable slice of all elements that have not been yielded
Expand Down

0 comments on commit 9b86c59

Please sign in to comment.