add lifetime for `while` and `for` expression

This commit is contained in:
FuGangqiang 2015-03-21 23:59:30 +08:00 committed by Manish Goregaokar
parent 5836efdfe7
commit 7ec80fa31c
1 changed files with 2 additions and 2 deletions

View File

@ -3158,7 +3158,7 @@ ten_times(|j| println!("hello, {}", j));
### While loops
```{.ebnf .gram}
while_expr : "while" no_struct_literal_expr '{' block '}' ;
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
```
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.
### For expressions
```{.ebnf .gram}
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
```
A `for` expression is a syntactic construct for looping over elements provided