Skip to content

Commit 29638c5

Browse files
committed
head expression => scrutinee expression
1 parent aa6f004 commit 29638c5

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/expressions/loop-expr.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ while i < 10 {
7272
7373
A `while let` loop is semantically similar to a `while` loop but in place of a
7474
condition expression it expects the keyword `let` followed by a refutable
75-
pattern, an `=`, an expression and a block expression. If the value of the expression on
76-
the right hand side of the `=` matches the pattern, the loop body block executes then
77-
control returns to the pattern matching statement. Otherwise, the while
78-
expression completes.
75+
pattern, an `=`, a scrutinee expression and a block expression. If the value of
76+
the expression on the right hand side of the `=` matches the pattern, the loop
77+
body block executes then control returns to the pattern matching statement.
78+
Otherwise, the while expression completes.
7979

8080
```rust
8181
let mut x = vec![1, 2, 3];

src/expressions/match-expr.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525
2626
A *`match` expression* branches on a pattern. The exact form of matching that
2727
occurs depends on the [pattern]. A `match`
28-
expression has a *head expression*, which is the value to compare to the
29-
patterns. The head expression and the patterns must have the same type.
28+
expression has a *scrutinee expression*, which is the value to compare to the
29+
patterns. The scrutinee expression and the patterns must have the same type.
3030

31-
A `match` behaves differently depending on whether or not the head expression
32-
is a [place expression or value expression][place expression].
33-
If the head expression is a [value expression], it is first evaluated into a
34-
temporary location, and the resulting value is sequentially compared to the
31+
A `match` behaves differently depending on whether or not the scrutinee
32+
expression is a [place expression or value expression][place expression].
33+
If the scrutinee expression is a [value expression], it is first evaluated into
34+
a temporary location, and the resulting value is sequentially compared to the
3535
patterns in the arms until a match is found. The first arm with a matching
3636
pattern is chosen as the branch target of the `match`, any variables bound by
3737
the pattern are assigned to local variables in the arm's block, and control
3838
enters the block.
3939

40-
When the head expression is a [place expression], the match does not allocate a
41-
temporary location; however, a by-value binding may copy or move from the
42-
memory location.
40+
When the scrutinee expression is a [place expression], the match does not
41+
allocate a temporary location; however, a by-value binding may copy or move
42+
from the memory location.
4343
When possible, it is preferable to match on place expressions, as the lifetime
4444
of these matches inherits the lifetime of the place expression rather than being
4545
restricted to the inside of the match.

src/expressions/struct-expr.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ let base = Point3d {x: 1, y: 2, z: 3};
7171
Point3d {y: 0, z: 10, .. base};
7272
```
7373

74-
Struct expressions with curly braces can't be used directly in the head of a [loop] or an
75-
[if], [if let] or [match] expression. However, struct expressions can be in used in these
76-
situations if they are within another expression, for example inside
77-
[parentheses].
74+
Struct expressions with curly braces can't be used directly in a [loop] or [if]
75+
expression's head, or in the scrutinee of a [if let] or [match] expression.
76+
However, struct expressions can be in used in these situations if they are
77+
within another expression, for example inside [parentheses].
7878

7979
The field names can be decimal integer values to specify indices for constructing tuple
8080
structs. This can be used with base structs to fill out the remaining indices not

src/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Patterns are used in:
6969

7070
Patterns can be used to *destructure* [structs], [enums], and [tuples].
7171
Destructuring breaks up a value into its component pieces. The syntax used is
72-
almost the same as when creating such values. In a pattern whose head
72+
almost the same as when creating such values. In a pattern whose scrutinee
7373
expression has a `struct`, `enum` or `tuple` type, a placeholder (`_`) stands
7474
in for a *single* data field, whereas a wildcard `..` stands in for *all* the
7575
remaining fields of a particular variant. When destructuring a data structure

0 commit comments

Comments
 (0)