diff --git a/tests/ui/pattern/issue-117626.rs b/tests/ui/pattern/issue-117626.rs new file mode 100644 index 00000000000..f87147a5d88 --- /dev/null +++ b/tests/ui/pattern/issue-117626.rs @@ -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, + }; +}