diff options
| author | FuGangqiang <fu_gangqiang@163.com> | 2015-03-21 23:59:30 +0800 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-03-23 04:54:27 +0530 |
| commit | 7ec80fa31c0bcb74fbe5e000015826a210a69034 (patch) | |
| tree | 82ea1b936801543bc590a3c0a86716df0324dc16 /src/doc/reference.md | |
| parent | 5836efdfe7077e10fe7ba69f0cb01d1ca93fa47b (diff) | |
| download | rust-7ec80fa31c0bcb74fbe5e000015826a210a69034.tar.gz rust-7ec80fa31c0bcb74fbe5e000015826a210a69034.zip | |
add lifetime for `while` and `for` expression
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index b23a8d91069..415ec4e4fbf 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -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 |
