about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-09-15 22:09:48 +0200
committerGitHub <noreply@github.com>2025-09-15 22:09:48 +0200
commit4950bf5c19f982eeba569756ba053b56d8141b39 (patch)
tree9fc234db238d05c60f467ae0eaf6b8fe68526437
parentf34e30affa126c807f9f97ea63487ce3985aff40 (diff)
parent16c720645cac29e71cc897374bb462fab42a8682 (diff)
downloadrust-4950bf5c19f982eeba569756ba053b56d8141b39.tar.gz
rust-4950bf5c19f982eeba569756ba053b56d8141b39.zip
Rollup merge of #146533 - Zalathar:array-default, r=compiler-errors
Note some previous attempts to change the Default impl for `[T; 0]`

Recently, rust-lang/rust#145457 experimented with changing the Default impl for `[T; 0]`.

Subsequently, rust-lang/rust#146531 also aimed to perform a similar experiment.

It seems like a good idea to add some links to the relevant source code, so that the historical context of this tricky topic is easier to find.
-rw-r--r--library/core/src/array/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs
index d14419a23a1..d713e575b58 100644
--- a/library/core/src/array/mod.rs
+++ b/library/core/src/array/mod.rs
@@ -472,6 +472,11 @@ impl<T: Copy> SpecArrayClone for T {
 // The Default impls cannot be done with const generics because `[T; 0]` doesn't
 // require Default to be implemented, and having different impl blocks for
 // different numbers isn't supported yet.
+//
+// Trying to improve the `[T; 0]` situation has proven to be difficult.
+// Please see these issues for more context on past attempts and crater runs:
+// - https://github.com/rust-lang/rust/issues/61415
+// - https://github.com/rust-lang/rust/pull/145457
 
 macro_rules! array_impl_default {
     {$n:expr, $t:ident $($ts:ident)*} => {