Skip to content

Commit

Permalink
Rollup merge of #66786 - jyn514:const-if-match-tests, r=Centril
Browse files Browse the repository at this point in the history
Add wildcard test for const_if_match

Closes #66758

Many thanks to @Centril for his help getting me started!
  • Loading branch information
tmandry authored Nov 26, 2019
2 parents 84a2d66 + f1f83ef commit 7f166e4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/consts/control-flow/single-arm-match-wild.rs
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 7f166e4

Please sign in to comment.