summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const_in_pattern/issue-65466.rs
blob: 2b421f4c705ecddea3ab9d3cc5b94b6c4fdf14cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![deny(indirect_structural_match)]

// check-pass

#[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 => (),
        _ => (),
    }
}