Skip to content

Commit 67176f7

Browse files
committed
Add const-types test
1 parent 5cf45bc commit 67176f7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
2+
--> $DIR/const-types.rs:3:12
3+
|
4+
LL | #![feature(const_generics)]
5+
| ^^^^^^^^^^^^^^
6+

0 commit comments

Comments
 (0)