summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/unconditional_panic_98444.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lint/unconditional_panic_98444.rs')
-rw-r--r--tests/ui/lint/unconditional_panic_98444.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/lint/unconditional_panic_98444.rs b/tests/ui/lint/unconditional_panic_98444.rs
new file mode 100644
index 000000000..011fabfbb
--- /dev/null
+++ b/tests/ui/lint/unconditional_panic_98444.rs
@@ -0,0 +1,7 @@
+// build-fail
+
+fn main() {
+ let xs: [i32; 5] = [1, 2, 3, 4, 5];
+ let _ = &xs;
+ let _ = xs[7]; //~ ERROR: this operation will panic at runtime [unconditional_panic]
+}