rustc_mir_transform::match_branches

Function can_cast

Source
fn can_cast(
    tcx: TyCtxt<'_>,
    src_val: impl Into<u128>,
    src_layout: TyAndLayout<'_>,
    cast_ty: Ty<'_>,
    target_scalar: ScalarInt,
) -> bool
Expand description

Check if the cast constant using IntToInt is equal to the target constant.