summaryrefslogtreecommitdiffstats
path: root/src/test/ui/derives/derive-macro-const-default.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/derives/derive-macro-const-default.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/derives/derive-macro-const-default.rs b/src/test/ui/derives/derive-macro-const-default.rs
new file mode 100644
index 000000000..ce80271d2
--- /dev/null
+++ b/src/test/ui/derives/derive-macro-const-default.rs
@@ -0,0 +1,11 @@
+// check-pass
+#[derive(Clone, PartialEq, Debug)]
+struct Example<T, const N: usize = 1usize>([T; N]);
+
+fn main() {
+ let a = Example([(); 16]);
+ let b = a.clone();
+ if a != b {
+ let _c = format!("{:?}", a);
+ }
+}