Skip to content

Commit

Permalink
Add test for const generics struct constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Jun 7, 2019
1 parent a0e3e9a commit 647b4a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/ui/const-generics/array-wrapper-struct-ctor.rs
@@ -0,0 +1,15 @@
// run-pass

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash

struct ArrayStruct<T, const N: usize> {
data: [T; N],
}

struct ArrayTuple<T, const N: usize>([T; N]);

fn main() {
let _ = ArrayStruct { data: [0u32; 8] };
let _ = ArrayTuple([0u32; 8]);
}
6 changes: 6 additions & 0 deletions src/test/ui/const-generics/array-wrapper-struct-ctor.stderr
@@ -0,0 +1,6 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> $DIR/array-wrapper-struct-ctor.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^

0 comments on commit 647b4a4

Please sign in to comment.