rust/tests/ui/pattern/issue-117626.rs

22 lines
287 B
Rust
Raw Permalink Normal View History

//@ check-pass
2023-12-28 11:13:54 -06:00
#[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,
};
}