Skip to content

Commit 6942111

Browse files
committed
no need to go unsafe lol
1 parent e373144 commit 6942111

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

library/core/src/array/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,7 @@ mod default_impls {
400400
[T; N]: ArrayDefault,
401401
{
402402
fn default() -> [T; N] {
403-
assert_eq!(crate::mem::size_of::<[(); N]>(), 0);
404-
// SAFETY: it is always valid to use `zeroed` for zero-sized value.
405-
let arr: [(); N] = unsafe { crate::mem::zeroed() };
406-
arr.map(|_unit| DefaultHack::default_hack())
403+
[(); N].map(|_unit| DefaultHack::default_hack())
407404
}
408405
}
409406
}

0 commit comments

Comments
 (0)