2 ms·
> One of the more under-appreciated features of Rust is that it traps on integer overflow / underflow by default. I think this is only true on debug builds, w
by abound 3y ago
> One of the more under-appreciated features of Rust is that it traps on integer overflow / underflow by default.
I think this is only true on debug builds, with --release (which most Rust binaries an end-user uses should be compiled with) it just wraps [1] [2]
[1] https://github.com/rust-lang/rfcs/blob/26197104b7bb9a5a35db243d639aee6e46d35d75/text/0560-integer-overflow.md https://github.com/rust-lang/rfcs/blob/26197104b7bb9a5a35db2...
[2] https://stackoverflow.com/a/60238510 https://stackoverflow.com/a/60238510