summary refs log tree commit diff
path: root/tests/ui/consts/const_in_pattern/issue-65466.rs
blob: d45c32e170a6a26148fec6dd56f0c56b0dff0e7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![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 => (), //~WARN: the type must implement `PartialEq`
        //~| previously accepted
        _ => (),
    }
}