]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/alt-vec-unreachable.rs
Imported Upstream version 0.6
[rustc.git] / src / test / compile-fail / alt-vec-unreachable.rs
CommitLineData
223e47cc
LB
1fn main() {
2 let x: ~[(int, int)] = ~[];
3 match x {
4 [a, (2, 3), _] => (),
5 [(1, 2), (2, 3), b] => (), //~ ERROR unreachable pattern
6 _ => ()
7 }
8
9 match [~"foo", ~"bar", ~"baz"] {
10 [a, _, _, .._] => { io::println(a); }
11 [~"foo", ~"bar", ~"baz", ~"foo", ~"bar"] => { } //~ ERROR unreachable pattern
12 _ => { }
13 }
14
15 match ['a', 'b', 'c'] {
16 ['a', 'b', 'c', .._tail] => {}
17 ['a', 'b', 'c'] => {} //~ ERROR unreachable pattern
18 _ => {}
19 }
20}