Skip to content

Commit aea1700

Browse files
dgrunwaldManishearth
authored andcommitted
Fix some grammar inconsistencies for the '..' range notation.
Grammar changes: * allow 'for _ in 1..i {}' (fixes rust-lang#20241) * allow 'for _ in 1.. {}' as infinite loop * prevent use of range notation in contexts where only operators of high precedence are expected (fixes rust-lang#20811) Parser code cleanup: * remove RESTRICTION_NO_DOTS * make AS_PREC const and follow naming convention * make min_prec inclusive
1 parent 32094fb commit aea1700

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

reference.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3147,18 +3147,17 @@ The precedence of Rust binary operators is ordered as follows, going from
31473147
strong to weak:
31483148

31493149
```{.text .precedence}
3150-
* / %
31513150
as
3151+
* / %
31523152
+ -
31533153
<< >>
31543154
&
31553155
^
31563156
|
3157-
< > <= >=
3158-
== !=
3157+
== != < > <= >=
31593158
&&
31603159
||
3161-
=
3160+
= ..
31623161
```
31633162

31643163
Operators at the same precedence level are evaluated left-to-right. [Unary

0 commit comments

Comments
 (0)