Skip to main content

switch_targets_unreachable

Function switch_targets_unreachable 

Source
pub(crate) fn switch_targets_unreachable<'tcx>(
    tcx: TyCtxt<'tcx>,
    body: &Body<'tcx>,
    targets: &SwitchTargets,
) -> bool
Expand description

Whether a SwitchInt’s non-otherwise targets all lead straight to panic/unreachable (a debug_assert!/assert! dispatch). Such a switch is dead on the normal path and can be inlined by following only the otherwise edge.