Skip to content

Commit

Permalink
Merge pull request rust-lang#41 from ekse/parentheses-chained-compari…
Browse files Browse the repository at this point in the history
…sons

Document that parentheses are required for chained comparison operators (RFC 0).
  • Loading branch information
steveklabnik authored Apr 17, 2017
2 parents b060f73 + 0a55590 commit c6f4de7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ operators on standard types is given here.
: Greater than or equal.
Calls the `ge` method on the `std::cmp::PartialOrd` trait.

Parentheses are required when chaining comparison operators. For example, the
expression `a == b == c` is invalid and may be written as `(a == b) == c`.

### Type cast expressions

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

0 comments on commit c6f4de7

Please sign in to comment.