We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e3f1b1 commit c0a811aCopy full SHA for c0a811a
src/test/mir-opt/matches_u8.rs
@@ -0,0 +1,21 @@
1
+// EMIT_MIR_FOR_EACH_BIT_WIDTH
2
+// EMIT_MIR matches_u8.exhaustive_match.MatchBranchSimplification.diff
3
+
4
+pub enum E {
5
+ A,
6
+ B,
7
+}
8
9
+// This only breaks on u8's, but probably still have to test i8.
10
+#[no_mangle]
11
+pub fn exhaustive_match(e: E) -> u8 {
12
+ match e {
13
+ E::A => 0,
14
+ E::B => 1,
15
+ }
16
17
18
+fn main() {
19
+ assert_eq!(exhaustive_match(E::A), 0);
20
+ assert_eq!(exhaustive_match(E::B), 1);
21
0 commit comments