Skip to content

Commit 647b4a4

Browse files
committed
Add test for const generics struct constructor
1 parent a0e3e9a commit 647b4a4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
struct ArrayStruct<T, const N: usize> {
7+
data: [T; N],
8+
}
9+
10+
struct ArrayTuple<T, const N: usize>([T; N]);
11+
12+
fn main() {
13+
let _ = ArrayStruct { data: [0u32; 8] };
14+
let _ = ArrayTuple([0u32; 8]);
15+
}
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/array-wrapper-struct-ctor.rs:3:12
3+
|
4+
LL | #![feature(const_generics)]
5+
| ^^^^^^^^^^^^^^
6+

0 commit comments

Comments
 (0)