rust/tests/ui/consts/const_in_pattern/issue-78057.rs
Oli Scherer d1fd11f3f9 Prevent spurious unreachable pattern lints
Means you'll get more `non-exhaustive` patterns
2023-10-11 12:49:57 +00:00

17 lines
270 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)]`
_ => {}
}
}