Add const-types test

This commit is contained in:
varkor 2019-04-17 19:31:04 +01:00
parent 5cf45bc27a
commit 67176f751b
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,16 @@
// run-pass
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
#[allow(dead_code)]
struct ConstArray<T, const LEN: usize> {
array: [T; LEN],
}
fn main() {
let arr = ConstArray::<i32, 8> {
array: [0; 8],
};
}

View file

@ -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)]
| ^^^^^^^^^^^^^^