Integer wraparound makes an out-of-range result cycle within a fixed-width integer type. In Rust, use an explicit `wrapping_*` method when that behavior is part of the operation’s contract, rather than relying on the build mode’s overflow behavior. section 4.5.1 section 6.3
Wrap at the boundary
`assert_eq!(0xffu8.wrapping_add(1), 0);` and `assert_eq!(0u32.wrapping_sub(1), 0xffffffff);` make the intended boundary behavior visible in both the code and its tests. section 4.5.1
Ordinary addition can pass through different overflow behavior in tests and release builds: debug-mode tests check for overflow, while release builds use unchecked arithmetic. A property test over `i64` inputs exposes this pitfall when an addition panics on a generated pair. section 6.3
For generic addition, `num_traits::ops::wrapping::WrappingAdd` supplies a trait bound; the standard library has no equivalent trait. Test the result against `a.wrapping_add(b)`. Rust also offers `std::num::Wrapping` and per-type wrapping methods. Do not treat “C-compatible” as a guarantee for signed overflow in C, where it is undefined. section 6.3 section 4.5.1


