Skip to content

Commit 7a76490

Browse files
committed
Use American spelling for "labeled"
We follow American spellings in the Reference, but we had used the Commonwealth spelling "labelled" rather than the American spelling "labeled". Let's fix that and add the appropriate redirects.
1 parent 76d5c46 commit 7a76490

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

book.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ use-boolean-and = true
2323

2424
[output.html.redirect]
2525
"/crates-and-source-files.html#preludes-and-no_std" = "names/preludes.html"
26+
"/expressions/block-expr.html#labelled-block-expressions" = "block-expr.html#labeled-block-expressions"
2627
"/expressions/enum-variant-expr.html" = "struct-expr.html"
2728
"/expressions/if-expr.html#if-let-expressions" = "if-expr.html#if-let-patterns"
29+
"/expressions/loop-expr.html#labelled-block-expressions" = "loop-expr.html#labeled-block-expressions"
2830
"/expressions/loop-expr.html#predicate-pattern-loops" = "loop-expr.html#while-let-patterns"
2931
"/expressions/operator-expr.html#slice-dst-pointer-to-pointer-cast" = "operator-expr.html#pointer-to-pointer-cast"
3032
"/expressions/operator-expr.html#the-question-mark-operator" = "operator-expr.html#the-try-propagation-expression"

src/expressions/block-expr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ let a = unsafe { an_unsafe_fn() };
247247
```
248248

249249
r[expr.block.label]
250-
## Labelled block expressions
250+
## Labeled block expressions
251251

252-
Labelled block expressions are documented in the [Loops and other breakable expressions] section.
252+
Labeled block expressions are documented in the [Loops and other breakable expressions] section.
253253

254254
r[expr.block.attributes]
255255
## Attributes on block expressions
@@ -301,4 +301,4 @@ fn is_unix_platform() -> bool {
301301
[tuple expressions]: tuple-expr.md
302302
[unsafe operations]: ../unsafety.md
303303
[value expressions]: ../expressions.md#place-expressions-and-value-expressions
304-
[Loops and other breakable expressions]: loop-expr.md#labelled-block-expressions
304+
[Loops and other breakable expressions]: expr.loop.block-labels

src/expressions/loop-expr.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ Rust supports four loop expressions:
1818
* A [`loop` expression](#infinite-loops) denotes an infinite loop.
1919
* A [`while` expression](#predicate-loops) loops until a predicate is false.
2020
* A [`for` expression](#iterator-loops) extracts values from an iterator, looping until the iterator is empty.
21-
* A [labelled block expression](#labelled-block-expressions) runs a loop exactly once, but allows exiting the loop early with `break`.
21+
* A [labeled block expression][expr.loop.block-labels] runs a loop exactly once, but allows exiting the loop early with `break`.
2222

2323
r[expr.loop.break-label]
2424
All four types of loop support [`break` expressions](#break-expressions), and [labels](#loop-labels).
2525

2626
r[expr.loop.continue-label]
27-
All except labelled block expressions support [`continue` expressions](#continue-expressions).
27+
All except labeled block expressions support [`continue` expressions](#continue-expressions).
2828

2929
r[expr.loop.explicit-result]
30-
Only `loop` and labelled block expressions support [evaluation to non-trivial values](#break-and-loop-values).
30+
Only `loop` and labeled block expressions support [evaluation to non-trivial values](#break-and-loop-values).
3131

3232
r[expr.loop.infinite]
3333
## Infinite loops
@@ -309,21 +309,21 @@ r[expr.loop.break.value]
309309
A `break` expression is only permitted in the body of a loop, and has one of the forms `break`, `break 'label` or ([see below](#break-and-loop-values)) `break EXPR` or `break 'label EXPR`.
310310

311311
r[expr.loop.block-labels]
312-
## Labelled block expressions
312+
## Labeled block expressions
313313

314314
r[expr.loop.block-labels.syntax]
315315
```grammar,expressions
316316
LabelBlockExpression -> BlockExpression
317317
```
318318

319319
r[expr.loop.block-labels.intro]
320-
Labelled block expressions are exactly like block expressions, except that they allow using `break` expressions within the block.
320+
Labeled block expressions are exactly like block expressions, except that they allow using `break` expressions within the block.
321321

322322
r[expr.loop.block-labels.break]
323-
Unlike loops, `break` expressions within a labelled block expression *must* have a label (i.e. the label is not optional).
323+
Unlike loops, `break` expressions within a labeled block expression *must* have a label (i.e. the label is not optional).
324324

325325
r[expr.loop.block-labels.label-required]
326-
Similarly, labelled block expressions *must* begin with a label.
326+
Similarly, labeled block expressions *must* begin with a label.
327327

328328
```rust
329329
# fn do_thing() {}

src/macros-by-example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ For more detail, see the [formal specification].
710710

711711
[`extern crate self`]: items.extern-crate.self
712712
[`macro_use` prelude]: names/preludes.md#macro_use-prelude
713-
[block labels]: expressions/loop-expr.md#labelled-block-expressions
713+
[block labels]: expr.loop.block-labels
714714
[delimiters]: tokens.md#delimiters
715715
[formal specification]: macro-ambiguity.md
716716
[Hygiene]: #hygiene

src/names/namespaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ It is still an error for a [`use` import] to shadow another macro, regardless of
137137
[Attribute macros]: ../procedural-macros.md#the-proc_macro_attribute-attribute
138138
[attributes]: ../attributes.md
139139
[bang-style macros]: ../macros.md
140-
[Block labels]: ../expressions/loop-expr.md#labelled-block-expressions
140+
[Block labels]: expr.loop.block-labels
141141
[boolean]: ../types/boolean.md
142142
[Built-in attributes]: ../attributes.md#built-in-attributes-index
143143
[closure parameters]: ../expressions/closure-expr.md

0 commit comments

Comments
 (0)