mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
20 lines
297 B
Rust
20 lines
297 B
Rust
// skip-filecheck
|
|
// unit-test: ConstGoto
|
|
|
|
pub enum Foo {
|
|
A,
|
|
B,
|
|
C,
|
|
D,
|
|
E,
|
|
F,
|
|
}
|
|
|
|
// EMIT_MIR const_goto.issue_77355_opt.ConstGoto.diff
|
|
fn issue_77355_opt(num: Foo) -> u64 {
|
|
if matches!(num, Foo::B | Foo::C) { 23 } else { 42 }
|
|
}
|
|
fn main() {
|
|
issue_77355_opt(Foo::A);
|
|
}
|