Skip to content

Commit eb94116

Browse files
committed
Document that parentheses are required for chained comparison
operators (RFC 0000).
1 parent b060f73 commit eb94116

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/expressions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ operators on standard types is given here.
436436
: Greater than or equal.
437437
Calls the `ge` method on the `std::cmp::PartialOrd` trait.
438438

439+
Parentheses are required when chaining comparison operators. For example, the
440+
expression `a == b == c` is invalid and may be written as `((a == b) == c)`.
441+
439442
### Type cast expressions
440443

441444
A type cast expression is denoted with the binary operator `as`.

0 commit comments

Comments
 (0)