mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
19 lines
433 B
Rust
19 lines
433 B
Rust
// skip-filecheck
|
|
// compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=0
|
|
// ignore-debug: standard library debug assertions add a panic that breaks this optimization
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
pub enum Thing {
|
|
A,
|
|
B,
|
|
}
|
|
|
|
// EMIT_MIR duplicate_switch_targets.ub_if_b.PreCodegen.after.mir
|
|
pub unsafe fn ub_if_b(t: Thing) -> Thing {
|
|
match t {
|
|
Thing::A => t,
|
|
Thing::B => std::hint::unreachable_unchecked(),
|
|
}
|
|
}
|