get_switched_on_type in rustc_mir_transform::unreachable_enum_branching - Rust
Description: If the basic block terminates by switching on a discriminant, this returns the `Ty` the discriminant is read from. Otherwise, returns None.

Skip to main content

## get_switched_on_type

# Function get_switched_on_type

Source

    fn get_switched_on_type<'tcx>(
        block_data: &BasicBlockData<'tcx>,
        tcx: TyCtxt<'tcx>,
        body: &Body<'tcx>,
    ) -> Option<Ty<'tcx>>

Expand description

If the basic block terminates by switching on a discriminant, this returns the `Ty` the discriminant is read from. Otherwise, returns None.