Skip to main content

switch_is_debug_assert

Function switch_is_debug_assert 

Source
pub(crate) fn switch_is_debug_assert<'tcx>(
    tcx: TyCtxt<'tcx>,
    body: &Body<'tcx>,
    bb: BasicBlock,
) -> bool
Expand description

Whether a block’s SwitchInt is a debug_assert!-style dispatch (all non-otherwise targets are panic/unreachable), or has a constant / runtime-check discriminant that folds to a single live edge. Such a switch is dead on the normal path and is safe to ignore when inlining.