From bed7d842eea883915f3757af0326f90c56a87aee Mon Sep 17 00:00:00 2001 From: bors Date: Fri, 29 Apr 2022 14:39:14 +0000 Subject: [PATCH] Auto merge of #96489 - shepmaster:revert-vec-from-array-ref, r=yaahc Revert "impl From<&[T; N]> and From<&mut [T; N]> for Vec" This reverts commit 5dd702763ae0e112332a4447171adbed51aeee3d. --- library/alloc/src/vec/mod.rs | 42 ------------------------------------ 1 file changed, 42 deletions(-) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 0b62622de819e..68df914b62694 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2931,48 +2931,6 @@ impl From<[T; N]> for Vec { } } -#[cfg(not(no_global_oom_handling))] -#[stable(feature = "vec_from_array_ref", since = "1.61.0")] -impl From<&[T; N]> for Vec { - /// Allocate a `Vec` and fill it by cloning `s`'s items. - /// - /// # Examples - /// - /// ``` - /// assert_eq!(Vec::from(b"raw"), vec![b'r', b'a', b'w']); - /// ``` - #[cfg(not(test))] - fn from(s: &[T; N]) -> Vec { - s.to_vec() - } - - #[cfg(test)] - fn from(s: &[T; N]) -> Vec { - crate::slice::to_vec(s, Global) - } -} - -#[cfg(not(no_global_oom_handling))] -#[stable(feature = "vec_from_array_ref", since = "1.61.0")] -impl From<&mut [T; N]> for Vec { - /// Allocate a `Vec` and fill it by cloning `s`'s items. - /// - /// # Examples - /// - /// ``` - /// assert_eq!(Vec::from(&mut [1, 2, 3]), vec![1, 2, 3]); - /// ``` - #[cfg(not(test))] - fn from(s: &mut [T; N]) -> Vec { - s.to_vec() - } - - #[cfg(test)] - fn from(s: &mut [T; N]) -> Vec { - crate::slice::to_vec(s, Global) - } -} - #[stable(feature = "vec_from_cow_slice", since = "1.14.0")] impl<'a, T> From> for Vec where