summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/issue-12369.rs
blob: 0481c1fd9e1bbdb4e5d67e96396ce3087b6c9e6e (plain)
1
2
3
4
5
6
7
8
9
10
11
#![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
    };
}