book
book copied to clipboard
Chapter 3: Integer overflow handling in --release mode
- [x] I have checked the latest
main
branch to see if this has already been fixed - [x] I have searched existing issues and pull requests for duplicates
URL to the section(s) of the book with this problem:
https://github.com/rust-lang/book/blob/1b8746013079f2e2ce1c8e85f633d9769778ea7f/src/ch03-02-data-types.md#integer-overflow https://github.com/rust-lang/book/blob/f17df27fc14696912c48b8b7a7a8fa49e648088d/nostarch/chapter03.md#integer-overflow
Description of the problem:
Noticed a Stackoverflow question regarding the integer overflow functionality in --release -mode while compiling. See https://stackoverflow.com/questions/70776125/why-does-rust-perform-integer-overflow-checks-in-release
Suggested fix:
Adding a word "runtime" as a constraint:
When you’re compiling in release mode with the --release flag, Rust does not include runtime checks for integer overflow that cause panics.