mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 16:15:03 +00:00
12 lines
254 B
Rust
12 lines
254 B
Rust
#![deny(unreachable_patterns)]
|
|
|
|
fn main() {
|
|
let sl = vec![1,2,3];
|
|
let v: isize = match &*sl {
|
|
&[] => 0,
|
|
&[a,b,c] => 3,
|
|
&[a, ref rest @ ..] => a,
|
|
&[10,a, ref rest @ ..] => 10 //~ ERROR: unreachable pattern
|
|
};
|
|
}
|