no-overflow-check-after-overflow Disallow overflow tests that perform the overflowing operation first Comparing an unsigned arithmetic result with an operand observes overflow only after it has occurred. Instead, you MUST use checked arithmetic or the overflow flag returned by an overflowing operation. - Category: correctness - Level: error - Fix: suggestion - Scope: module Reported function overflows(left: uint32, right: uint32): boolean { return left + right < left; } Accepted function overflows(left: uint32, right: uint32): boolean { return left.checkedAdd(right) === undefined; } Prior art - Clippy ยท panickingoverflowchecks language/linter/src/rules/correctness/nooverflowcheckafteroverflow.rs:8