diff options
| author | varkor <github@varkor.com> | 2019-06-01 11:57:22 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-06-02 01:55:46 +0100 |
| commit | e82cd9528c127aff90d58a25573b9aeb43616c2b (patch) | |
| tree | 39902d717648fb45269ce16dfb63947a2a4d26b4 | |
| parent | 5a2410a07c8b151cd518792f41fce3341af004cf (diff) | |
| download | rust-e82cd9528c127aff90d58a25573b9aeb43616c2b.tar.gz rust-e82cd9528c127aff90d58a25573b9aeb43616c2b.zip | |
Add regression test for #61422
| -rw-r--r-- | src/test/ui/const-generics/issue-61422.rs | 15 | ||||
| -rw-r--r-- | src/test/ui/const-generics/issue-61422.stderr | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/issue-61422.rs b/src/test/ui/const-generics/issue-61422.rs new file mode 100644 index 00000000000..3ccf38e5619 --- /dev/null +++ b/src/test/ui/const-generics/issue-61422.rs @@ -0,0 +1,15 @@ +// run-pass + +#![feature(const_generics)] +//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash + +use std::mem; + +fn foo<const SIZE: usize>() { + let arr: [u8; SIZE] = unsafe { + let mut array: [u8; SIZE] = mem::uninitialized(); + array + }; +} + +fn main() {} diff --git a/src/test/ui/const-generics/issue-61422.stderr b/src/test/ui/const-generics/issue-61422.stderr new file mode 100644 index 00000000000..4cb76ec4fe1 --- /dev/null +++ b/src/test/ui/const-generics/issue-61422.stderr @@ -0,0 +1,6 @@ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/issue-61422.rs:3:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + |
