summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/unused-broken-const.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/unused-broken-const.rs')
-rw-r--r--tests/ui/consts/const-eval/unused-broken-const.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/unused-broken-const.rs b/tests/ui/consts/const-eval/unused-broken-const.rs
new file mode 100644
index 000000000..0d2776bc2
--- /dev/null
+++ b/tests/ui/consts/const-eval/unused-broken-const.rs
@@ -0,0 +1,8 @@
+// make sure that an *unused* broken const triggers an error even in a check build
+
+// compile-flags: --emit=dep-info,metadata
+
+const FOO: i32 = [][0];
+//~^ ERROR evaluation of constant value failed
+
+fn main() {}