diff --git a/src/test/ui/const-generics/const-types.rs b/src/test/ui/const-generics/const-types.rs new file mode 100644 index 000000000000..11757cd588da --- /dev/null +++ b/src/test/ui/const-generics/const-types.rs @@ -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 { + array: [T; LEN], +} + +fn main() { + let arr = ConstArray:: { + array: [0; 8], + }; +} diff --git a/src/test/ui/const-generics/const-types.stderr b/src/test/ui/const-generics/const-types.stderr new file mode 100644 index 000000000000..fbf5d5375416 --- /dev/null +++ b/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)] + | ^^^^^^^^^^^^^^ +