summaryrefslogtreecommitdiffstats
path: root/src/test/ui/match/match-bot-panic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/match/match-bot-panic.rs')
-rw-r--r--src/test/ui/match/match-bot-panic.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/match/match-bot-panic.rs b/src/test/ui/match/match-bot-panic.rs
new file mode 100644
index 000000000..e4a6f6d6f
--- /dev/null
+++ b/src/test/ui/match/match-bot-panic.rs
@@ -0,0 +1,16 @@
+// run-fail
+// error-pattern:explicit panic
+// ignore-emscripten no processes
+
+#![allow(unreachable_code)]
+#![allow(unused_variables)]
+
+fn foo(s: String) {}
+
+fn main() {
+ let i = match Some::<isize>(3) {
+ None::<isize> => panic!(),
+ Some::<isize>(_) => panic!(),
+ };
+ foo(i);
+}