summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/unused-broken-const.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const-eval/unused-broken-const.rs')
-rw-r--r--src/test/ui/consts/const-eval/unused-broken-const.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-eval/unused-broken-const.rs b/src/test/ui/consts/const-eval/unused-broken-const.rs
new file mode 100644
index 000000000..3b4523681
--- /dev/null
+++ b/src/test/ui/consts/const-eval/unused-broken-const.rs
@@ -0,0 +1,9 @@
+// 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 any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler but is being phased out
+
+fn main() {}