rust/tests/ui/consts/const_in_pattern/issue-65466.rs
2024-02-16 20:02:50 +00:00

23 lines
371 B
Rust

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