From 376e2cb16d8a0447a29b3e42199908922978a276 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Wed, 28 Mar 2018 14:33:10 +0100 Subject: [PATCH] Fixes for operator precedence Clarify associativity Remove unstable operators --- src/expressions.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/expressions.md b/src/expressions.md index 84516a9bd..4716386d3 100644 --- a/src/expressions.md +++ b/src/expressions.md @@ -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 | |-----------------------------|---------------------| @@ -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 | @@ -66,7 +66,6 @@ evaluated in the order given by their associativity. | `&&` | left to right | | || | left to right | | `..` `..=` | Require parentheses | -| `<-` | right to left | | `=` `+=` `-=` `*=` `/=` `%=`
`&=` |= `^=` `<<=` `>>=` | right to left | | `return` `break` closures | |