summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-15104.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-15104.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-15104.rs b/src/test/ui/issues/issue-15104.rs
new file mode 100644
index 000000000..47b207ea9
--- /dev/null
+++ b/src/test/ui/issues/issue-15104.rs
@@ -0,0 +1,13 @@
+// run-pass
+
+fn main() {
+ assert_eq!(count_members(&[1, 2, 3, 4]), 4);
+}
+
+fn count_members(v: &[usize]) -> usize {
+ match *v {
+ [] => 0,
+ [_] => 1,
+ [_, ref xs @ ..] => 1 + count_members(xs)
+ }
+}