summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/expr-match-panic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/expr-match-panic.rs')
-rw-r--r--tests/ui/binding/expr-match-panic.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/binding/expr-match-panic.rs b/tests/ui/binding/expr-match-panic.rs
new file mode 100644
index 000000000..4b6b6e072
--- /dev/null
+++ b/tests/ui/binding/expr-match-panic.rs
@@ -0,0 +1,14 @@
+// run-pass
+
+
+fn test_simple() {
+ let r = match true { true => { true } false => { panic!() } };
+ assert_eq!(r, true);
+}
+
+fn test_box() {
+ let r = match true { true => { vec![10] } false => { panic!() } };
+ assert_eq!(r[0], 10);
+}
+
+pub fn main() { test_simple(); test_box(); }