Function std::intrinsics::unchecked_div

const: 1.52.0 · source ·
pub const unsafe extern "rust-intrinsic" fn unchecked_div<T>(
    x: T,
    y: T
) -> Twhere
    T: Copy,
🔬This is a nightly-only experimental API. (core_intrinsics)
Expand description

执行未经检查的除法,从而导致 y == 0x == T::MIN && y == -1 出现不确定的行为

可通过 checked_div 方法在整数原语上使用此内部函数的安全包装。 例如, u32::checked_div