about summary refs log tree commit diff
path: root/tests/ui/consts/const_in_pattern/issue-65466.rs
blob: 82838657b02f59989ad6c62ecbd5b314ee6c0b31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(PartialEq, Eq)]
enum O<T> {
    Some(*const T), // Can also use PhantomData<T>
    None,
}

struct B;

const C: &[O<B>] = &[O::None];

fn main() {
    let x = O::None;
    match &[x][..] {
        C => (), //~ ERROR constant of non-structural type `&[O<B>]` in a pattern
        _ => (),
    }
}