mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
18 lines
309 B
Rust
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
|
|
}
|
|
}
|