summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const_in_pattern/incomplete-slice.rs
blob: e1ccda71d40eaf5d352fd572a582db497704c826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[derive(PartialEq)]
enum E {
    A,
}

const E_SL: &[E] = &[E::A];

fn main() {
    match &[][..] {
        //~^ ERROR non-exhaustive patterns: `&_` not covered [E0004]
        E_SL => {}
        //~^ WARN to use a constant of type `E` in a pattern, `E` must be annotated with `#[derive(PartialEq, Eq)]`
        //~| WARN this was previously accepted by the compiler but is being phased out
    }
}