Hacker News new | ask | show | jobs
by Thorrez 2655 days ago
I've never used rust, but from what I've heard, it crashes in debug mode, and wraps (two's complement) in release mode.
2 comments

> it crashes in debug mode, and wraps (two's complement) in release mode.

Well, that's indeed a nice feature in debug mode. Mostly wraparound is undesired and wraparound bugs are pretty common. Shame the performance cost is too much to do same in release.

Whenever wraparound semantics it is actually wanted, one can use an appropriate type.

That’s the default semantics, yes.