summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/nested-pattern.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/nested-pattern.rs')
-rw-r--r--tests/ui/binding/nested-pattern.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/binding/nested-pattern.rs b/tests/ui/binding/nested-pattern.rs
new file mode 100644
index 000000000..7d14c9ad9
--- /dev/null
+++ b/tests/ui/binding/nested-pattern.rs
@@ -0,0 +1,16 @@
+// run-pass
+#![allow(dead_code)]
+#![allow(non_camel_case_types)]
+
+// a bug was causing this to complain about leaked memory on exit
+
+enum t { foo(isize, usize), bar(isize, Option<isize>), }
+
+fn nested(o: t) {
+ match o {
+ t::bar(_i, Some::<isize>(_)) => { println!("wrong pattern matched"); panic!(); }
+ _ => { println!("succeeded"); }
+ }
+}
+
+pub fn main() { nested(t::bar(1, None::<isize>)); }