2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2023-04-23 04:38:37 -05:00
|
|
|
// compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=0
|
2023-04-19 19:42:18 -05:00
|
|
|
// ignore-debug: standard library debug assertions add a panic that breaks this optimization
|
2023-04-23 04:38:37 -05:00
|
|
|
|
2023-04-19 19:42:18 -05:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
pub enum Thing {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
}
|
|
|
|
|
2023-04-23 04:38:37 -05:00
|
|
|
// EMIT_MIR duplicate_switch_targets.ub_if_b.PreCodegen.after.mir
|
2023-04-19 19:42:18 -05:00
|
|
|
pub unsafe fn ub_if_b(t: Thing) -> Thing {
|
|
|
|
match t {
|
|
|
|
Thing::A => t,
|
|
|
|
Thing::B => std::hint::unreachable_unchecked(),
|
|
|
|
}
|
|
|
|
}
|