Hacker News new | ask | show | jobs
by djrenren 2092 days ago
I dont think Rust traps on overflow in release builds
2 comments

That's correct, it's not a zero-cost abstraction.

Also the wrapping types aren't unsafe, they just make it explicit.

. 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.