@@ -208,7 +208,7 @@ The keywords are the following strings:
208
208
~~~~ {.notrust .keyword}
209
209
as
210
210
box break
211
- crate
211
+ continue crate
212
212
else enum extern
213
213
false fn for
214
214
if impl in
@@ -2924,18 +2924,16 @@ while i < 10 {
2924
2924
2925
2925
### Infinite loops
2926
2926
2927
- The keyword ` loop ` in Rust appears both in _ loop expressions_ and in _ continue expressions_ .
2928
- A loop expression denotes an infinite loop;
2929
- see [ Continue expressions] ( #continue-expressions ) for continue expressions.
2927
+ A ` loop ` expression denotes an infinite loop.
2930
2928
2931
2929
~~~~ {.notrust .ebnf .gram}
2932
2930
loop_expr : [ lifetime ':' ] "loop" '{' block '}';
2933
2931
~~~~
2934
2932
2935
2933
A ` loop ` expression may optionally have a _ label_ .
2936
2934
If a label is present,
2937
- then labeled ` break ` and ` loop ` expressions nested within this loop may exit out of this loop or return control to its head.
2938
- See [ Break expressions] ( #break-expressions ) .
2935
+ then labeled ` break ` and ` continue ` expressions nested within this loop may exit out of this loop or return control to its head.
2936
+ See [ Break expressions] ( #break-expressions ) and [ Continue expressions ] ( #continue-expressions ) .
2939
2937
2940
2938
### Break expressions
2941
2939
@@ -2953,21 +2951,21 @@ but must enclose it.
2953
2951
### Continue expressions
2954
2952
2955
2953
~~~~ {.notrust .ebnf .gram}
2956
- continue_expr : "loop " [ lifetime ];
2954
+ continue_expr : "continue " [ lifetime ];
2957
2955
~~~~
2958
2956
2959
- A continue expression, written ` loop ` , also has an optional ` label ` .
2957
+ A ` continue ` expression has an optional ` label ` .
2960
2958
If the label is absent,
2961
- then executing a ` loop ` expression immediately terminates the current iteration of the innermost loop enclosing it,
2959
+ then executing a ` continue ` expression immediately terminates the current iteration of the innermost loop enclosing it,
2962
2960
returning control to the loop * head* .
2963
2961
In the case of a ` while ` loop,
2964
2962
the head is the conditional expression controlling the loop.
2965
2963
In the case of a ` for ` loop, the head is the call-expression controlling the loop.
2966
- If the label is present, then ` loop foo` returns control to the head of the loop with label ` foo ` ,
2964
+ If the label is present, then ` continue foo` returns control to the head of the loop with label ` foo ` ,
2967
2965
which need not be the innermost label enclosing the ` break ` expression,
2968
2966
but must enclose it.
2969
2967
2970
- A ` loop ` expression is only permitted in the body of a loop.
2968
+ A ` continue ` expression is only permitted in the body of a loop.
2971
2969
2972
2970
### For expressions
2973
2971
0 commit comments