about summary refs log tree commit diff
path: root/tests/ui/pattern
diff options
context:
space:
mode:
authorEric Mark Martin <ericmarkmartin@gmail.com>2023-07-01 02:28:15 -0400
committerEric Mark Martin <ericmarkmartin@gmail.com>2023-07-01 02:28:15 -0400
commit7dfb9eda25d1973fd8b70f95174e31c1443dde6a (patch)
tree2afb23a7c1510cbd79585a7e3df64620bee6697a /tests/ui/pattern
parent76a7772759247e00365a90be936504289c359165 (diff)
downloadrust-7dfb9eda25d1973fd8b70f95174e31c1443dde6a.tar.gz
rust-7dfb9eda25d1973fd8b70f95174e31c1443dde6a.zip
add regression test
Diffstat (limited to 'tests/ui/pattern')
-rw-r--r--tests/ui/pattern/issue-110508.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/pattern/issue-110508.rs b/tests/ui/pattern/issue-110508.rs
new file mode 100644
index 00000000000..1024ff05578
--- /dev/null
+++ b/tests/ui/pattern/issue-110508.rs
@@ -0,0 +1,38 @@
+// run-pass
+
+#[derive(PartialEq, Eq)]
+pub enum Foo {
+    FooA(()),
+    FooB(Vec<()>),
+}
+
+impl Foo {
+    const A1: Foo = Foo::FooA(());
+    const A2: Foo = Self::FooA(());
+    const A3: Self = Foo::FooA(());
+    const A4: Self = Self::FooA(());
+}
+
+fn main() {
+    let foo = Foo::FooA(());
+
+    match foo {
+        Foo::A1 => {},
+        _ => {},
+    }
+
+    match foo {
+        Foo::A2 => {},
+        _ => {},
+    }
+
+    match foo {
+        Foo::A3 => {},
+        _ => {},
+    }
+
+    match foo {
+        Foo::A4 => {},
+        _ => {},
+    }
+}