diff options
| author | bohan <bohan-zhang@foxmail.com> | 2023-12-29 01:13:54 +0800 |
|---|---|---|
| committer | bohan <bohan-zhang@foxmail.com> | 2023-12-29 01:13:54 +0800 |
| commit | 437f07b3cf68a43b1fbe1c04650aa4d3d9bbbafc (patch) | |
| tree | d4c7ed1ed347b8b4724208195b741bd7f6888c3f | |
| parent | f4d794ea0b845413344621d89f6c945062748485 (diff) | |
| download | rust-437f07b3cf68a43b1fbe1c04650aa4d3d9bbbafc.tar.gz rust-437f07b3cf68a43b1fbe1c04650aa4d3d9bbbafc.zip | |
add test for #117626
| -rw-r--r-- | tests/ui/pattern/issue-117626.rs | 21 |
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, + }; +} |
