We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e373144 commit 6942111Copy full SHA for 6942111
library/core/src/array/mod.rs
@@ -400,10 +400,7 @@ mod default_impls {
400
[T; N]: ArrayDefault,
401
{
402
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())
+ [(); N].map(|_unit| DefaultHack::default_hack())
407
}
408
409
0 commit comments