rust/tests/ui/pattern/usefulness/issue-12369.rs
2023-01-11 09:32:08 +00:00

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
};
}