We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
const-types
1 parent 5cf45bc commit 67176f7Copy full SHA for 67176f7
src/test/ui/const-generics/const-types.rs
@@ -0,0 +1,16 @@
1
+// run-pass
2
+
3
+#![feature(const_generics)]
4
+//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
5
6
+#[allow(dead_code)]
7
8
+struct ConstArray<T, const LEN: usize> {
9
+ array: [T; LEN],
10
+}
11
12
+fn main() {
13
+ let arr = ConstArray::<i32, 8> {
14
+ array: [0; 8],
15
+ };
16
src/test/ui/const-generics/const-types.stderr
@@ -0,0 +1,6 @@
+warning: the feature `const_generics` is incomplete and may cause the compiler to crash
+ --> $DIR/const-types.rs:3:12
+ |
+LL | #![feature(const_generics)]
+ | ^^^^^^^^^^^^^^
0 commit comments