From 72d84ba4417aabfe2ba6cc3b578d1c6a21c3b6e3 Mon Sep 17 00:00:00 2001 From: Smittyvb Date: Thu, 17 Jun 2021 08:20:52 -0400 Subject: [PATCH 1/2] Mention that MAX / -1 and MAX % -1 always panic --- src/expressions/operator-expr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index 545c884ec..d4f6053c0 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -24,7 +24,7 @@ The following things are considered to be overflow: * When `+`, `*` or `-` create a value greater than the maximum value, or less than the minimum value that can be stored. This includes unary `-` on the smallest value of any signed integer type. -* Using `/` or `%`, where the left-hand argument is the smallest integer of a signed integer type and the right-hand argument is `-1`. +* 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. * 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. ## Borrow operators From da0ec46c13b46af8a1bd88a1c4794e3b9402b522 Mon Sep 17 00:00:00 2001 From: Smittyvb Date: Thu, 17 Jun 2021 08:37:45 -0400 Subject: [PATCH 2/2] Use one sentence per line Co-authored-by: Yuki Okushi --- src/expressions/operator-expr.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index d4f6053c0..77d042fbb 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -24,7 +24,8 @@ The following things are considered to be overflow: * When `+`, `*` or `-` create a value greater than the maximum value, or less than the minimum value that can be stored. This includes unary `-` on the smallest value of any signed integer type. -* 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. +* 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. * 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. ## Borrow operators