mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
22 lines
287 B
Rust
22 lines
287 B
Rust
//@ check-pass
|
|
|
|
#[derive(PartialEq)]
|
|
struct NonMatchable;
|
|
|
|
impl Eq for NonMatchable {}
|
|
|
|
#[derive(PartialEq, Eq)]
|
|
enum Foo {
|
|
A(NonMatchable),
|
|
B(*const u8),
|
|
}
|
|
|
|
const CONST: Foo = Foo::B(std::ptr::null());
|
|
|
|
fn main() {
|
|
match CONST {
|
|
CONST => 0,
|
|
_ => 1,
|
|
};
|
|
}
|