summaryrefslogtreecommitdiffstats
path: root/src/test/ui/deriving/deriving-default-box.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/deriving/deriving-default-box.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/deriving/deriving-default-box.rs b/src/test/ui/deriving/deriving-default-box.rs
new file mode 100644
index 000000000..b71e11496
--- /dev/null
+++ b/src/test/ui/deriving/deriving-default-box.rs
@@ -0,0 +1,13 @@
+// run-pass
+use std::default::Default;
+
+#[derive(Default)]
+struct A {
+ foo: Box<[bool]>,
+}
+
+pub fn main() {
+ let a: A = Default::default();
+ let b: Box<[_]> = Box::<[bool; 0]>::new([]);
+ assert_eq!(a.foo, b);
+}