Skip to content

Commit a40494b

Browse files
authored
Rollup merge of rust-lang#66800 - jyn514:combine-const-match-tests, r=Dylan-DPC
Combine similar tests for const match See rust-lang#66788 (comment) for context.
2 parents 999fd56 + 9617d7c commit a40494b

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

src/test/ui/consts/control-flow/exhaustive-c-like-enum-match.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,14 @@ const fn f(e: E) {
1818
}
1919
}
2020

21-
fn main() {}
21+
const fn g(e: E) -> usize {
22+
match e {
23+
_ => 0
24+
}
25+
}
26+
27+
fn main() {
28+
const X: usize = g(E::C);
29+
assert_eq!(X, 0);
30+
assert_eq!(g(E::A), 0);
31+
}

src/test/ui/consts/control-flow/single-arm-match-wild.rs

-21
This file was deleted.

0 commit comments

Comments
 (0)