about summary refs log tree commit diff
path: root/tests/ui/consts/module-const-array-size-13763.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/module-const-array-size-13763.rs')
-rw-r--r--tests/ui/consts/module-const-array-size-13763.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/consts/module-const-array-size-13763.rs b/tests/ui/consts/module-const-array-size-13763.rs
new file mode 100644
index 00000000000..67b9bdc5f03
--- /dev/null
+++ b/tests/ui/consts/module-const-array-size-13763.rs
@@ -0,0 +1,14 @@
+//@ run-pass
+#![allow(dead_code)]
+
+mod u8 {
+    pub const BITS: usize = 8;
+}
+
+const NUM: usize = u8::BITS;
+
+struct MyStruct { nums: [usize; 8] }
+
+fn main() {
+    let _s = MyStruct { nums: [0; NUM] };
+}