rust/tests/ui/consts/const_in_pattern/issue-78057.rs
2023-01-11 09:32:08 +00:00

18 lines
309 B
Rust

#![deny(unreachable_patterns)]
#[derive(PartialEq)]
struct Opaque(i32);
impl Eq for Opaque {}
const FOO: Opaque = Opaque(42);
fn main() {
match FOO {
FOO => {},
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
_ => {}
//~^ ERROR unreachable pattern
}
}