Skip to content

Commit cff0411

Browse files
committed
Auto merge of #28476 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #28276, #28314, #28422, #28435, #28451, #28466, #28470, #28471, #28473, #28474 - Failed merges:
2 parents a06812f + 5faff5d commit cff0411

File tree

8 files changed

+142
-104
lines changed

8 files changed

+142
-104
lines changed

src/doc/reference.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,7 @@ The following expressions are equivalent.
27622762
let x = std::ops::Range {start: 0, end: 10};
27632763
let y = 0..10;
27642764
2765-
assert_eq!(x,y);
2765+
assert_eq!(x, y);
27662766
```
27672767

27682768
### Unary operator expressions
@@ -3035,18 +3035,18 @@ A `loop` expression may optionally have a _label_. The label is written as
30353035
a lifetime preceding the loop expression, as in `'foo: loop{ }`. If a
30363036
label is present, then labeled `break` and `continue` expressions nested
30373037
within this loop may exit out of this loop or return control to its head.
3038-
See [Break expressions](#break-expressions) and [Continue
3038+
See [break expressions](#break-expressions) and [continue
30393039
expressions](#continue-expressions).
30403040

3041-
### Break expressions
3041+
### `break` expressions
30423042

30433043
A `break` expression has an optional _label_. If the label is absent, then
30443044
executing a `break` expression immediately terminates the innermost loop
30453045
enclosing it. It is only permitted in the body of a loop. If the label is
30463046
present, then `break 'foo` terminates the loop with label `'foo`, which need not
30473047
be the innermost label enclosing the `break` expression, but must enclose it.
30483048

3049-
### Continue expressions
3049+
### `continue` expressions
30503050

30513051
A `continue` expression has an optional _label_. If the label is absent, then
30523052
executing a `continue` expression immediately terminates the current iteration
@@ -3059,7 +3059,7 @@ innermost label enclosing the `break` expression, but must enclose it.
30593059

30603060
A `continue` expression is only permitted in the body of a loop.
30613061

3062-
### While loops
3062+
### `while` loops
30633063

30643064
A `while` loop begins by evaluating the boolean loop conditional expression.
30653065
If the loop conditional expression evaluates to `true`, the loop body block
@@ -3082,12 +3082,12 @@ Like `loop` expressions, `while` loops can be controlled with `break` or
30823082
loops](#infinite-loops), [break expressions](#break-expressions), and
30833083
[continue expressions](#continue-expressions) for more information.
30843084

3085-
### For expressions
3085+
### `for` expressions
30863086

30873087
A `for` expression is a syntactic construct for looping over elements provided
30883088
by an implementation of `std::iter::IntoIterator`.
30893089

3090-
An example of a for loop over the contents of an array:
3090+
An example of a `for` loop over the contents of an array:
30913091

30923092
```
30933093
# type Foo = i32;
@@ -3117,7 +3117,7 @@ Like `loop` expressions, `for` loops can be controlled with `break` or
31173117
loops](#infinite-loops), [break expressions](#break-expressions), and
31183118
[continue expressions](#continue-expressions) for more information.
31193119

3120-
### If expressions
3120+
### `if` expressions
31213121

31223122
An `if` expression is a conditional branch in program control. The form of an
31233123
`if` expression is a condition expression, followed by a consequent block, any
@@ -3129,7 +3129,7 @@ evaluates to `false`, the consequent block is skipped and any subsequent `else
31293129
if` condition is evaluated. If all `if` and `else if` conditions evaluate to
31303130
`false` then any `else` block is executed.
31313131

3132-
### Match expressions
3132+
### `match` expressions
31333133

31343134
A `match` expression branches on a *pattern*. The exact form of matching that
31353135
occurs depends on the pattern. Patterns consist of some combination of
@@ -3235,7 +3235,7 @@ let message = match maybe_digit {
32353235
};
32363236
```
32373237

3238-
### If let expressions
3238+
### `if let` expressions
32393239

32403240
An `if let` expression is semantically identical to an `if` expression but in place
32413241
of a condition expression it expects a refutable let statement. If the value of the
@@ -3256,15 +3256,15 @@ if let ("Ham", b) = dish {
32563256
}
32573257
```
32583258

3259-
### While let loops
3259+
### `while let` loops
32603260

32613261
A `while let` loop is semantically identical to a `while` loop but in place of a
32623262
condition expression it expects a refutable let statement. If the value of the
32633263
expression on the right hand side of the let statement matches the pattern, the
32643264
loop body block executes and control returns to the pattern matching statement.
32653265
Otherwise, the while expression completes.
32663266

3267-
### Return expressions
3267+
### `return` expressions
32683268

32693269
Return expressions are denoted with the keyword `return`. Evaluating a `return`
32703270
expression moves its argument into the designated output location for the

src/doc/trpl/error-handling.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ thread '<main>' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5
8787
Here's another example that is slightly less contrived. A program that accepts
8888
an integer as an argument, doubles it and prints it.
8989

90+
<a name="code-unwrap-double"/>
9091
```rust,should_panic
92+
9193
use std::env;
9294
9395
fn main() {
@@ -120,7 +122,7 @@ It would be better if we just showed the code for unwrapping because it is so
120122
simple, but to do that, we will first need to explore the `Option` and `Result`
121123
types. Both of these types have a method called `unwrap` defined on them.
122124

123-
## The `Option` type
125+
### The `Option` type
124126

125127
The `Option` type is [defined in the standard library][5]:
126128

@@ -137,6 +139,7 @@ system is an important concept because it will cause the compiler to force the
137139
programmer to handle that absence. Let's take a look at an example that tries
138140
to find a character in a string:
139141

142+
<a name="code-option-ex-string-find"/>
140143
```rust
141144
// Searches `haystack` for the Unicode character `needle`. If one is found, the
142145
// byte offset of the character is returned. Otherwise, `None` is returned.

src/doc/trpl/guessing-game.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ With this definition, anything of type `Foo` can be either a
599599
`Foo::Bar` or a `Foo::Baz`. We use the `::` to indicate the
600600
namespace for a particular `enum` variant.
601601

602-
The [`Ordering`][ordering] enum has three possible variants: `Less`, `Equal`,
602+
The [`Ordering`][ordering] `enum` has three possible variants: `Less`, `Equal`,
603603
and `Greater`. The `match` statement takes a value of a type, and lets you
604604
create an ‘arm’ for each possible value. Since we have three types of
605605
`Ordering`, we have three arms:
@@ -918,9 +918,9 @@ let guess: u32 = match guess.trim().parse() {
918918
919919
This is how you generally move from ‘crash on error’ to ‘actually handle the
920920
error’, by switching from `ok().expect()` to a `match` statement. The `Result`
921-
returned by `parse()` is an enum just like `Ordering`, but in this case, each
921+
returned by `parse()` is an `enum` just like `Ordering`, but in this case, each
922922
variant has some data associated with it: `Ok` is a success, and `Err` is a
923-
failure. Each contains more information: the successful parsed integer, or an
923+
failure. Each contains more information: the successfully parsed integer, or an
924924
error type. In this case, we `match` on `Ok(num)`, which sets the inner value
925925
of the `Ok` to the name `num`, and then we just return it on the right-hand
926926
side. In the `Err` case, we don’t care what kind of error it is, so we just

src/doc/trpl/installing-rust.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Oh, we should also mention the officially supported platforms:
6464

6565
* Windows (7, 8, Server 2008 R2)
6666
* Linux (2.6.18 or later, various distributions), x86 and x86-64
67-
* OSX 10.7 (Lion) or greater, x86 and x86-64
67+
* OSX 10.7 (Lion) or later, x86 and x86-64
6868

6969
We extensively test Rust on these platforms, and a few others, too, like
7070
Android. But these are the ones most likely to work, as they have the most

0 commit comments

Comments
 (0)