3 ms·
Doesn't Rust arithmetic wraparound on release? I read Microsoft's Midori language paniced/abandoned on overflow even in release, and the compiler got quite good
by jimbo1qaz 7y ago
Doesn't Rust arithmetic wraparound on release? I read Microsoft's Midori language paniced/abandoned on overflow even in release, and the compiler got quite good at optimizing overflow checks away.
- steveklabnik 7y agoThe rules are slightly more complex than that to allow the behavior to change in the future, but they currently two’s compliment wrapping, yes.
- fluffything 7y agoIf you wrap around you get implementation defined behavior, which can be chosen to either panic!, or wrap-around. In release, the default is wrap-around, but you can set it to panic.