logoalt Hacker News

vlovich123today at 12:50 PM1 replyview on HN

In hot paths it can be even more. This is why even Rust defines it as wrapping but elides the overflow panic in release builds.


Replies

steveklabniktoday at 1:23 PM

It is defined as an error. That error’s default handling is wrapping when debug_assertions is off, and panic when it’s on, but since it’s an incorrect program (though not UB) either behavior is acceptable in any mode.

show 1 reply