5 ms·
I dont think Rust traps on overflow in release builds
by djrenren 6y ago
I dont think Rust traps on overflow in release builds
- carlmr 6y agoThat's correct, it's not a zero-cost abstraction. Also the wrapping types aren't unsafe, they just make it explicit.
- fluffy87 6y ago. In release mode, the behavior of integer overflow in Rust is modulo two arithmetic instead of not UB/cannot happen. These two are not the same thing. See my reply to masklin.