Skip to content

Commit 6235897

Browse files
authored
Merge pull request #1382 from mattheww/2023-07_divzero
Say that division by zero for primitive types panics
2 parents 5b7b383 + cf1cc8d commit 6235897

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/expressions/operator-expr.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ The operands of all of these operators are evaluated in [value expression contex
243243
| `+` | Addition | | Addition | `std::ops::Add` | `std::ops::AddAssign` |
244244
| `-` | Subtraction | | Subtraction | `std::ops::Sub` | `std::ops::SubAssign` |
245245
| `*` | Multiplication | | Multiplication | `std::ops::Mul` | `std::ops::MulAssign` |
246-
| `/` | Division* | | Division | `std::ops::Div` | `std::ops::DivAssign` |
247-
| `%` | Remainder** | | Remainder | `std::ops::Rem` | `std::ops::RemAssign` |
246+
| `/` | Division* | | Division | `std::ops::Div` | `std::ops::DivAssign` |
247+
| `%` | Remainder** | | Remainder | `std::ops::Rem` | `std::ops::RemAssign` |
248248
| `&` | Bitwise AND | [Logical AND] | | `std::ops::BitAnd` | `std::ops::BitAndAssign` |
249249
| <code>&#124;</code> | Bitwise OR | [Logical OR] | | `std::ops::BitOr` | `std::ops::BitOrAssign` |
250250
| `^` | Bitwise XOR | [Logical XOR] | | `std::ops::BitXor` | `std::ops::BitXorAssign` |
@@ -258,6 +258,8 @@ The operands of all of these operators are evaluated in [value expression contex
258258
\*\*\* Arithmetic right shift on signed integer types, logical right shift on
259259
unsigned integer types.
260260

261+
† Division by zero panics.
262+
261263
Here are examples of these operators being used.
262264

263265
```rust

0 commit comments

Comments
 (0)