]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/match/match-vec-unreachable.rs
1 #![feature(slice_patterns)]
2 #![deny(unreachable_patterns)]
5 let x
: Vec
<(isize, isize)> = Vec
::new();
6 let x
: &[(isize, isize)] = &x
;
9 [(1, 2), (2, 3), b
] => (), //~ ERROR unreachable pattern
13 let x
: Vec
<String
> = vec
!["foo".to_string(),
16 let x
: &[String
] = &x
;
18 [ref a
, _
, _
, ..] => { println!("{}
", a); }
19 [_, _, _, _, _] => { } //~ ERROR unreachable pattern
23 let x: Vec<char> = vec!['a', 'b', 'c'];
26 ['a', 'b', 'c', ref _tail @ ..] => {}
27 ['a', 'b', 'c'] => {} //~ ERROR unreachable pattern