Rollup merge of #117636 - bvanjoi:fix-117626, r=TaKO8Ki

add test for #117626

Close #117626
This commit is contained in:
Matthias Krüger 2024-01-04 15:33:56 +01:00 committed by GitHub
commit 5c47d77c1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,
};
}