]> git.lizzy.rs Git - rust.git/commitdiff
Add regression test for #66756
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Tue, 26 Nov 2019 19:37:16 +0000 (11:37 -0800)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Tue, 26 Nov 2019 19:37:16 +0000 (11:37 -0800)
src/test/ui/consts/control-flow/exhaustive-c-like-enum-match.rs [new file with mode: 0644]

diff --git a/src/test/ui/consts/control-flow/exhaustive-c-like-enum-match.rs b/src/test/ui/consts/control-flow/exhaustive-c-like-enum-match.rs
new file mode 100644 (file)
index 0000000..d24179d
--- /dev/null
@@ -0,0 +1,27 @@
+// Test for <https://github.com/rust-lang/rust/issues/66756>
+
+// check-pass
+
+#![feature(const_if_match)]
+
+enum E {
+    A,
+    B,
+    C
+}
+
+const fn f(e: E) {
+    match e {
+        E::A => {}
+        E::B => {}
+        E::C => {}
+    }
+}
+
+const fn g(e: E) {
+    match e {
+        _ => {}
+    }
+}
+
+fn main() {}