Hacker News new | past | comments | ask | show | jobs | submit login

Rust does use runtime checks for overflows and will panic if an overflow happens. In cases where you don't care or where it's intentional you can use `overflowing_add()` and its variants.



... in debug builds only, by default. In release, by default, there are no checks, and you get two’s compliment overflow, though the correct thing to do is use those variants, yes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: