about summary refs log tree commit diff
path: root/src/test/run-pass/deriving-clone-array.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-12-07 02:16:13 +0000
committerbors <bors@rust-lang.org>2015-12-07 02:16:13 +0000
commite819d8aa3cd2319fa57e7336e167069ef7002d6a (patch)
tree75670a56bca0942333b80fa08f6dbe1b5ba06c3f /src/test/run-pass/deriving-clone-array.rs
parent64c21f9ee2c6a7e6a530d4bb889676c296e1fe68 (diff)
parent0ca2a9e71a9d907b79c3ca296163d313dc3234eb (diff)
Auto merge of #30247 - bluss:revert-array-clone, r=alexcrichton
Revert "PR #30130 Implement `Clone` for more arrays"

This reverts commit e22a64e8d8d4da46c74f878ce1c23ad1c88982e8.

This caused a regression such that types like `[[u8; 256]; 4]`
no longer implemented Clone. This previously worked due to Clone
for `[T; N]` (N in 0 to 32) being implemented for T: Copy.

Due to fixed size arrays not implementing Clone for sizes above 32,
the new implementation requiring T: Clone would not allow
`[[u8; 256]; 4]` to be Clone.

Fixes #30244

Due to changing back, this is technically a [breaking-change],
albeit for a behavior that existed for a very short time.
Diffstat (limited to 'src/test/run-pass/deriving-clone-array.rs')
-rw-r--r--src/test/run-pass/deriving-clone-array.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/run-pass/deriving-clone-array.rs b/src/test/run-pass/deriving-clone-array.rs
new file mode 100644
index 00000000000..182a1390b1f
--- /dev/null
+++ b/src/test/run-pass/deriving-clone-array.rs
@@ -0,0 +1,18 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// test for issue #30244
+
+#[derive(Copy, Clone)]
+struct Array {
+    arr: [[u8; 256]; 4]
+}
+
+pub fn main() {}