This commit is contained in:
bohan 2023-12-29 01:13:54 +08:00
parent f4d794ea0b
commit 437f07b3cf
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
// 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,
};
}