| Okay, so let's review the language's rules here: * There are two modes for overflow checking: enabled, and default. * If overflow checking is in "enabled" mode, overflow results in a panic. * If overflow checking is in "default" mode, the results are two's compliment wrapping. * Debug builds are "enabled" mode. (There's a few other details, but this is good enough for our discussion. See https://github.com/rust-lang/rfcs/blob/master/text/0560-inte... ) Rustc implements this as follows: * When debug_assertions is on, it's in "enabled" mode. * Otherwise, it’s in “default” mode. * -C overflow-checks turns on "enabled" mode, regardless of other settings. This is completely consistent with the rules of the language. If these checks ever get cheap enough, rustc may even start to turn them on by default, which is also acceptable under these rules. We'll see if that ever happens, though. |