From 67176f751b03404112cc7f9e25ea3081d834f144 Mon Sep 17 00:00:00 2001 From: varkor Date: Wed, 17 Apr 2019 19:31:04 +0100 Subject: [PATCH] Add `const-types` test --- src/test/ui/const-generics/const-types.rs | 16 ++++++++++++++++ src/test/ui/const-generics/const-types.stderr | 6 ++++++ 2 files changed, 22 insertions(+) create mode 100644 src/test/ui/const-generics/const-types.rs create mode 100644 src/test/ui/const-generics/const-types.stderr 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)] + | ^^^^^^^^^^^^^^ +