rust/tests/ui/consts/const_in_pattern/issue-65466.rs

18 lines
305 B
Rust

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