Skip to content

Commit 762bb1f

Browse files
committed
Revert "impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>"
This reverts commit 5dd7027.
1 parent 69a5d24 commit 762bb1f

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

library/alloc/src/vec/mod.rs

-42
Original file line numberDiff line numberDiff line change
@@ -2987,48 +2987,6 @@ impl<T, const N: usize> From<[T; N]> for Vec<T> {
29872987
}
29882988
}
29892989

2990-
#[cfg(not(no_global_oom_handling))]
2991-
#[stable(feature = "vec_from_array_ref", since = "1.61.0")]
2992-
impl<T: Clone, const N: usize> From<&[T; N]> for Vec<T> {
2993-
/// Allocate a `Vec<T>` and fill it by cloning `s`'s items.
2994-
///
2995-
/// # Examples
2996-
///
2997-
/// ```
2998-
/// assert_eq!(Vec::from(b"raw"), vec![b'r', b'a', b'w']);
2999-
/// ```
3000-
#[cfg(not(test))]
3001-
fn from(s: &[T; N]) -> Vec<T> {
3002-
s.to_vec()
3003-
}
3004-
3005-
#[cfg(test)]
3006-
fn from(s: &[T; N]) -> Vec<T> {
3007-
crate::slice::to_vec(s, Global)
3008-
}
3009-
}
3010-
3011-
#[cfg(not(no_global_oom_handling))]
3012-
#[stable(feature = "vec_from_array_ref", since = "1.61.0")]
3013-
impl<T: Clone, const N: usize> From<&mut [T; N]> for Vec<T> {
3014-
/// Allocate a `Vec<T>` and fill it by cloning `s`'s items.
3015-
///
3016-
/// # Examples
3017-
///
3018-
/// ```
3019-
/// assert_eq!(Vec::from(&mut [1, 2, 3]), vec![1, 2, 3]);
3020-
/// ```
3021-
#[cfg(not(test))]
3022-
fn from(s: &mut [T; N]) -> Vec<T> {
3023-
s.to_vec()
3024-
}
3025-
3026-
#[cfg(test)]
3027-
fn from(s: &mut [T; N]) -> Vec<T> {
3028-
crate::slice::to_vec(s, Global)
3029-
}
3030-
}
3031-
30322990
#[stable(feature = "vec_from_cow_slice", since = "1.14.0")]
30332991
impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
30342992
where

0 commit comments

Comments
 (0)