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.
2 parents ba412a6 + ae38e4d commit 099af82Copy full SHA for 099af82
library/core/src/array/mod.rs
@@ -484,7 +484,7 @@ macro_rules! array_impl_default {
484
};
485
{$n:expr,} => {
486
#[stable(since = "1.4.0", feature = "array_default")]
487
- impl<T> Default for [T; $n] {
+ impl<T> Default for [T; $n] where T: Default {
488
fn default() -> [T; $n] { [] }
489
}
490
library/coretests/tests/array.rs
@@ -292,13 +292,6 @@ fn array_default_impl_avoids_leaks_on_panic() {
292
assert_eq!(COUNTER.load(Relaxed), 0);
293
294
295
-#[test]
296
-fn empty_array_is_always_default() {
297
- struct DoesNotImplDefault;
298
-
299
- let _arr = <[DoesNotImplDefault; 0]>::default();
300
-}
301
302
#[test]
303
fn array_map() {
304
let a = [1, 2, 3];
0 commit comments