From 582affd657701aa8fff42b9e0eb32d23796167b5 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Tue, 26 Nov 2019 11:37:16 -0800 Subject: [PATCH] Add regression test for #66756 --- .../exhaustive-c-like-enum-match.rs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/ui/consts/control-flow/exhaustive-c-like-enum-match.rs 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 index 00000000000..d24179d856f --- /dev/null +++ b/src/test/ui/consts/control-flow/exhaustive-c-like-enum-match.rs @@ -0,0 +1,27 @@ +// Test for + +// 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() {} -- 2.44.0