Static rustc_lint_defs::builtin::ARITHMETIC_OVERFLOW

source ·
Expand description

The arithmetic_overflow lint detects that an arithmetic operation will overflow.


1_i32 << 32;



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.