Skip to content

Commit 2172d2a

Browse files
committed
Rollup merge of #29058 - tshepang:rename, r=steveklabnik
Shoud have been part of commit 0b13ee0
2 parents 7d478f4 + ea37fad commit 2172d2a

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

src/doc/reference.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ let p: Point = (41, 68);
10761076

10771077
### Structs
10781078

1079-
A _structure_ is a nominal [structure type](#structure-types) defined with the
1079+
A _struct_ is a nominal [struct type](#struct-types) defined with the
10801080
keyword `struct`.
10811081

10821082
An example of a `struct` item and its use:
@@ -1087,7 +1087,7 @@ let p = Point {x: 10, y: 11};
10871087
let px: i32 = p.x;
10881088
```
10891089

1090-
A _tuple structure_ is a nominal [tuple type](#tuple-types), also defined with
1090+
A _tuple struct_ is a nominal [tuple type](#tuple-types), also defined with
10911091
the keyword `struct`. For example:
10921092

10931093
```
@@ -1096,8 +1096,8 @@ let p = Point(10, 11);
10961096
let px: i32 = match p { Point(x, _) => x };
10971097
```
10981098

1099-
A _unit-like struct_ is a structure without any fields, defined by leaving off
1100-
the list of fields entirely. Such a structure implicitly defines a constant of
1099+
A _unit-like struct_ is a struct without any fields, defined by leaving off
1100+
the list of fields entirely. Such a struct implicitly defines a constant of
11011101
its type with the same name. For example:
11021102

11031103
```
@@ -1115,7 +1115,7 @@ const Cookie: Cookie = Cookie {};
11151115
let c = [Cookie, Cookie {}, Cookie, Cookie {}];
11161116
```
11171117

1118-
The precise memory layout of a structure is not specified. One can specify a
1118+
The precise memory layout of a struct is not specified. One can specify a
11191119
particular layout using the [`repr` attribute](#ffi-attributes).
11201120

11211121
### Enumerations
@@ -2404,7 +2404,7 @@ items.
24042404

24052405
An _item declaration statement_ has a syntactic form identical to an
24062406
[item](#items) declaration within a module. Declaring an item — a
2407-
function, enumeration, structure, type, static, trait, implementation or module
2407+
function, enumeration, struct, type, static, trait, implementation or module
24082408
— locally within a statement block is simply a way of restricting its
24092409
scope to a narrow region containing all of its uses; it is otherwise identical
24102410
in meaning to declaring the item outside the statement block.
@@ -2549,26 +2549,26 @@ comma:
25492549
(0); // zero in parentheses
25502550
```
25512551

2552-
### Structure expressions
2552+
### Struct expressions
25532553

2554-
There are several forms of structure expressions. A _structure expression_
2555-
consists of the [path](#paths) of a [structure item](#structs), followed by
2554+
There are several forms of struct expressions. A _struct expression_
2555+
consists of the [path](#paths) of a [struct item](#structs), followed by
25562556
a brace-enclosed list of one or more comma-separated name-value pairs,
2557-
providing the field values of a new instance of the structure. A field name
2557+
providing the field values of a new instance of the struct. A field name
25582558
can be any identifier, and is separated from its value expression by a colon.
2559-
The location denoted by a structure field is mutable if and only if the
2560-
enclosing structure is mutable.
2559+
The location denoted by a struct field is mutable if and only if the
2560+
enclosing struct is mutable.
25612561

2562-
A _tuple structure expression_ consists of the [path](#paths) of a [structure
2562+
A _tuple struct expression_ consists of the [path](#paths) of a [struct
25632563
item](#structs), followed by a parenthesized list of one or more
2564-
comma-separated expressions (in other words, the path of a structure item
2565-
followed by a tuple expression). The structure item must be a tuple structure
2564+
comma-separated expressions (in other words, the path of a struct item
2565+
followed by a tuple expression). The struct item must be a tuple struct
25662566
item.
25672567

2568-
A _unit-like structure expression_ consists only of the [path](#paths) of a
2569-
[structure item](#structs).
2568+
A _unit-like struct expression_ consists only of the [path](#paths) of a
2569+
[struct item](#structs).
25702570

2571-
The following are examples of structure expressions:
2571+
The following are examples of struct expressions:
25722572

25732573
```
25742574
# struct Point { x: f64, y: f64 }
@@ -2581,14 +2581,14 @@ let u = game::User {name: "Joe", age: 35, score: 100_000};
25812581
some_fn::<Cookie>(Cookie);
25822582
```
25832583

2584-
A structure expression forms a new value of the named structure type. Note
2585-
that for a given *unit-like* structure type, this will always be the same
2584+
A struct expression forms a new value of the named struct type. Note
2585+
that for a given *unit-like* struct type, this will always be the same
25862586
value.
25872587

2588-
A structure expression can terminate with the syntax `..` followed by an
2588+
A struct expression can terminate with the syntax `..` followed by an
25892589
expression to denote a functional update. The expression following `..` (the
2590-
base) must have the same structure type as the new structure type being formed.
2591-
The entire expression denotes the result of constructing a new structure (with
2590+
base) must have the same struct type as the new struct type being formed.
2591+
The entire expression denotes the result of constructing a new struct (with
25922592
the same type as the base expression) with the given values for the fields that
25932593
were explicitly specified and the values in the base expression for all other
25942594
fields.
@@ -2634,7 +2634,7 @@ the left-hand-side expression is an indirect [trait object](#trait-objects).
26342634
A _field expression_ consists of an expression followed by a single dot and an
26352635
identifier, when not immediately followed by a parenthesized expression-list
26362636
(the latter is a [method call expression](#method-call-expressions)). A field
2637-
expression denotes a field of a [structure](#structure-types).
2637+
expression denotes a field of a [struct](#struct-types).
26382638

26392639
```{.ignore .field}
26402640
mystruct.myfield;
@@ -3353,17 +3353,17 @@ As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
33533353
All in-bounds elements of arrays and slices are always initialized, and access
33543354
to an array or slice is always bounds-checked.
33553355

3356-
### Structure types
3356+
### Struct types
33573357

33583358
A `struct` *type* is a heterogeneous product of other types, called the
33593359
*fields* of the type.[^structtype]
33603360

33613361
[^structtype]: `struct` types are analogous to `struct` types in C,
33623362
the *record* types of the ML family,
3363-
or the *structure* types of the Lisp family.
3363+
or the *struct* types of the Lisp family.
33643364

33653365
New instances of a `struct` can be constructed with a [struct
3366-
expression](#structure-expressions).
3366+
expression](#struct-expressions).
33673367

33683368
The memory layout of a `struct` is undefined by default to allow for compiler
33693369
optimizations like field reordering, but it can be fixed with the
@@ -3373,14 +3373,14 @@ have the same memory layout.
33733373

33743374
The fields of a `struct` may be qualified by [visibility
33753375
modifiers](#visibility-and-privacy), to allow access to data in a
3376-
structure outside a module.
3376+
struct outside a module.
33773377

3378-
A _tuple struct_ type is just like a structure type, except that the fields are
3378+
A _tuple struct_ type is just like a struct type, except that the fields are
33793379
anonymous.
33803380

3381-
A _unit-like struct_ type is like a structure type, except that it has no
3382-
fields. The one value constructed by the associated [structure
3383-
expression](#structure-expressions) is the only value that inhabits such a
3381+
A _unit-like struct_ type is like a struct type, except that it has no
3382+
fields. The one value constructed by the associated [struct
3383+
expression](#struct-expressions) is the only value that inhabits such a
33843384
type.
33853385

33863386
### Enumerated types
@@ -3407,7 +3407,7 @@ named reference to an [`enum` item](#enumerations).
34073407
### Recursive types
34083408

34093409
Nominal types &mdash; [enumerations](#enumerated-types) and
3410-
[structs](#structure-types) &mdash; may be recursive. That is, each `enum`
3410+
[structs](#struct-types) &mdash; may be recursive. That is, each `enum`
34113411
constructor or `struct` field may refer, directly or indirectly, to the
34123412
enclosing `enum` or `struct` type itself. Such recursion has restrictions:
34133413

0 commit comments

Comments
 (0)