about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2019-11-25 19:44:35 -0500
committerJoshua Nelson <jyn514@gmail.com>2019-11-25 19:44:35 -0500
commit37f440fd9a3d6c79647549bf559d2c19712b83d9 (patch)
tree1b206325e3b48b3e443b02e6739b35c878e2d668
parent91642e3ac0120c8e9cdd5f3c85ad03f3bf1b8b69 (diff)
downloadrust-37f440fd9a3d6c79647549bf559d2c19712b83d9.tar.gz
rust-37f440fd9a3d6c79647549bf559d2c19712b83d9.zip
Add wildcard test for const_if_match
Closes https://github.com/rust-lang/rust/issues/66758
-rw-r--r--src/test/ui/consts/control-flow/single-arm-match-wild.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/consts/control-flow/single-arm-match-wild.rs b/src/test/ui/consts/control-flow/single-arm-match-wild.rs
new file mode 100644
index 00000000000..59a42bb05ca
--- /dev/null
+++ b/src/test/ui/consts/control-flow/single-arm-match-wild.rs
@@ -0,0 +1,19 @@
+// check-pass
+
+#![feature(const_if_match)]
+
+enum E {
+    A,
+    B,
+    C
+}
+
+const fn f(e: E) -> usize {
+    match e {
+        _ => 0
+    }
+}
+
+fn main() {
+    assert_eq!(f(E::A), 0);
+}