From ec980a21b06de1988afff7275bd8d4d44f73722c Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Thu, 20 Feb 2020 21:25:19 -0500 Subject: [PATCH] Add test for #69312 This bug was fixed by #67501. Closes #69312 --- src/test/ui/consts/issue-69312.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/test/ui/consts/issue-69312.rs diff --git a/src/test/ui/consts/issue-69312.rs b/src/test/ui/consts/issue-69312.rs new file mode 100644 index 0000000000000..413c67520798f --- /dev/null +++ b/src/test/ui/consts/issue-69312.rs @@ -0,0 +1,10 @@ +// build-pass + +// Verify that the compiler doesn't ICE during const prop while evaluating the index operation. + +#![allow(unconditional_panic)] + +fn main() { + let cols = [0u32; 0]; + cols[0]; +}