Skip to content

Commit 96794d8

Browse files
committed
fix test failure
1 parent ba46b61 commit 96794d8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/liballoc/vec.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -2402,8 +2402,13 @@ impl<T, const N: usize> From<[T; N]> for Vec<T>
24022402
where
24032403
[T; N]: LengthAtMost32,
24042404
{
2405-
fn from(arr: [T; N]) -> Self {
2406-
<[T]>::into_vec(box arr)
2405+
#[cfg(not(test))]
2406+
fn from(s: [T; N]) -> Vec<T> {
2407+
(box s as Box<[T]>).into_vec()
2408+
}
2409+
#[cfg(test)]
2410+
fn from(s: [T; N]) -> Vec<T> {
2411+
crate::slice::into_vec(box s)
24072412
}
24082413
}
24092414

0 commit comments

Comments
 (0)