Skip to content

Commit

Permalink
Merge pull request rust-lang#282 from matthewjasper/operator-precendence
Browse files Browse the repository at this point in the history
Fixes for operator precedence
  • Loading branch information
alercah authored May 3, 2018
2 parents 93c2953 + 376e2cb commit abc7493
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ and blocks again can recursively nest inside each other to an arbitrary depth.
## Expression precedence

The precedence of Rust operators and expressions is ordered as follows, going
from strong to weak. Binary Operators at the same precedence level are
evaluated in the order given by their associativity.
from strong to weak. Binary Operators at the same precedence level are grouped
in the order given by their associativity.

| Operator/Expression | Associativity |
|-----------------------------|---------------------|
Expand All @@ -55,7 +55,7 @@ evaluated in the order given by their associativity.
| Function calls, array indexing | |
| `?` | |
| Unary `-` `*` `!` `&` `&mut` | |
| `as` `:` | left to right |
| `as` | left to right |
| `*` `/` `%` | left to right |
| `+` `-` | left to right |
| `<<` `>>` | left to right |
Expand All @@ -66,7 +66,6 @@ evaluated in the order given by their associativity.
| `&&` | left to right |
| <code>&#124;&#124;</code> | left to right |
| `..` `..=` | Require parentheses |
| `<-` | right to left |
| `=` `+=` `-=` `*=` `/=` `%=` <br> `&=` <code>&#124;=</code> `^=` `<<=` `>>=` | right to left |
| `return` `break` closures | |

Expand Down

0 comments on commit abc7493

Please sign in to comment.