Skip to content

Commit 72d84ba

Browse files
authored
Mention that MAX / -1 and MAX % -1 always panic
1 parent 105a943 commit 72d84ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/expressions/operator-expr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The following things are considered to be overflow:
2424

2525
* When `+`, `*` or `-` create a value greater than the maximum value, or less than the minimum value that can be stored.
2626
This includes unary `-` on the smallest value of any signed integer type.
27-
* Using `/` or `%`, where the left-hand argument is the smallest integer of a signed integer type and the right-hand argument is `-1`.
27+
* Using `/` or `%`, where the left-hand argument is the smallest integer of a signed integer type and the right-hand argument is `-1`. These checks occur even when `-C overflow-checks` is disabled, for legacy reasons.
2828
* Using `<<` or `>>` where the right-hand argument is greater than or equal to the number of bits in the type of the left-hand argument, or is negative.
2929

3030
## Borrow operators

0 commit comments

Comments
 (0)