2016-11-29 01:10:26 -06:00
|
|
|
#![deny(unreachable_patterns)]
|
2015-03-26 20:34:27 -05:00
|
|
|
|
2014-05-20 23:42:30 -05:00
|
|
|
fn main() {
|
|
|
|
let sl = vec![1,2,3];
|
2015-02-01 20:53:25 -06:00
|
|
|
let v: isize = match &*sl {
|
2016-03-11 04:54:59 -06:00
|
|
|
&[] => 0,
|
|
|
|
&[a,b,c] => 3,
|
2019-07-07 18:47:46 -05:00
|
|
|
&[a, ref rest @ ..] => a,
|
|
|
|
&[10,a, ref rest @ ..] => 10 //~ ERROR: unreachable pattern
|
2014-05-20 23:42:30 -05:00
|
|
|
};
|
|
|
|
}
|