Skip to content

Commit 668b1a0

Browse files
authored
Update guidelines on arithmetic overflow handling
Clarify behavior of arithmetic overflow in Rust.
1 parent f504dbd commit 668b1a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/coding-guidelines/expressions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Expressions
1818
:tags: security, performance, numerics
1919

2020
Eliminate `arithmetic overflow <https://rust-lang.github.io/fls/expressions.html#arithmetic-overflow>`_ of both signed and unsigned integer types.
21+
Arithmetic overflow panics in debug mode, but wrapsaround in release mode.
22+
Any wraparound behavior must be explicitly specified to ensure the same behavior in both debug and release modes.
2123

2224
This rule applies to the following primitive types:
2325

0 commit comments

Comments
 (0)