From 9b86c5998c5b5b274b21651334a320aecc516dfc Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Mon, 6 Dec 2021 22:59:04 -0800 Subject: [PATCH] s/from_raw_parts/new_unchecked/ --- library/core/src/array/iter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index de3b7685385..0dc277785e8 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -126,7 +126,7 @@ impl IntoIter { /// 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)); /// } /// } /// } @@ -143,7 +143,7 @@ impl IntoIter { /// ``` #[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; N], initialized: Range, ) -> Self { @@ -210,7 +210,7 @@ impl IntoIter { // 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