2 ms·
The "Rust Book" says signed integer overflow to be two's complement in release builds and panic in debug builds: https://doc.rust-lang.org/book/ch03-02-data-typ
by roca 5y ago
The "Rust Book" says signed integer overflow to be two's complement in release builds and panic in debug builds:
https://doc.rust-lang.org/book/ch03-02-data-types.html https://doc.rust-lang.org/book/ch03-02-data-types.html
That's clear enough for programmers to rely on. It is nonsense to argue that this is equivalent to C's "the compiler may do anything it wants" just because the "Rust Book" is not called the "Rust Standard" or not "formal" enough.