[][src]Static rustc_ap_rustc_session::lint::builtin::ARITHMETIC_OVERFLOW

pub static  ARITHMETIC_OVERFLOW: &Lint

The arithmetic_overflow lint detects that an arithmetic operation will overflow.

Example

This example deliberately fails to compile
1_i32 << 32;

{{produces}}

Explanation

It is very likely a mistake to perform an arithmetic operation that overflows its value. If the compiler is able to detect these kinds of overflows at compile-time, it will trigger this lint. Consider adjusting the expression to avoid overflow, or use a data type that will not overflow.