about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbohan <bohan-zhang@foxmail.com>2023-12-29 01:13:54 +0800
committerbohan <bohan-zhang@foxmail.com>2023-12-29 01:13:54 +0800
commit437f07b3cf68a43b1fbe1c04650aa4d3d9bbbafc (patch)
treed4c7ed1ed347b8b4724208195b741bd7f6888c3f
parentf4d794ea0b845413344621d89f6c945062748485 (diff)
downloadrust-437f07b3cf68a43b1fbe1c04650aa4d3d9bbbafc.tar.gz
rust-437f07b3cf68a43b1fbe1c04650aa4d3d9bbbafc.zip
add test for #117626
-rw-r--r--tests/ui/pattern/issue-117626.rs21
1 files changed, 21 insertions, 0 deletions
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,
+    };
+}