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 0000000000000..fba6e3583cc29 --- /dev/null +++ b/src/test/ui/consts/control-flow/single-arm-match-wild.rs @@ -0,0 +1,21 @@ +// check-pass + +#![feature(const_if_match)] + +enum E { + A, + B, + C +} + +const fn f(e: E) -> usize { + match e { + _ => 0 + } +} + +fn main() { + const X: usize = f(E::C); + assert_eq!(X, 0); + assert_eq!(f(E::A), 0); +}