]>
git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/separate_const_switch.rs
1 #![feature(control_flow_enum)]
2 #![feature(try_trait_v2)]
4 use std
::ops
::ControlFlow
;
6 // EMIT_MIR separate_const_switch.too_complex.SeparateConstSwitch.diff
7 fn too_complex(x
: Result
<i32, usize>) -> Option
<i32> {
8 // The pass should break the outer match into
9 // two blocks that only have one parent each.
10 // Parents are one of the two branches of the first
11 // match, so a later pass can propagate constants.
14 Ok(v
) => ControlFlow
::Continue(v
),
15 Err(r
) => ControlFlow
::Break(r
),
18 ControlFlow
::Continue(v
) => Some(v
),
19 ControlFlow
::Break(r
) => None
,
23 // EMIT_MIR separate_const_switch.identity.SeparateConstSwitch.diff
24 fn identity(x
: Result
<i32, i32>) -> Result
<i32, i32> {