Skip to content

Commit bc9d9f2

Browse files
committed
add lifetime for while and for expression
1 parent c175b35 commit bc9d9f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/reference.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3158,7 +3158,7 @@ ten_times(|j| println!("hello, {}", j));
31583158
### While loops
31593159

31603160
```{.ebnf .gram}
3161-
while_expr : "while" no_struct_literal_expr '{' block '}' ;
3161+
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
31623162
```
31633163

31643164
A `while` loop begins by evaluating the boolean loop conditional expression.
@@ -3223,7 +3223,7 @@ A `continue` expression is only permitted in the body of a loop.
32233223
### For expressions
32243224

32253225
```{.ebnf .gram}
3226-
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
3226+
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
32273227
```
32283228

32293229
A `for` expression is a syntactic construct for looping over elements provided

0 commit comments

Comments
 (0)