@@ -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
10801080keyword ` struct ` .
10811081
10821082An example of a ` struct ` item and its use:
@@ -1087,7 +1087,7 @@ let p = Point {x: 10, y: 11};
10871087let 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
10911091the keyword ` struct ` . For example:
10921092
10931093```
@@ -1096,8 +1096,8 @@ let p = Point(10, 11);
10961096let 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
11011101its type with the same name. For example:
11021102
11031103```
@@ -1115,7 +1115,7 @@ const Cookie: Cookie = Cookie {};
11151115let 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
11191119particular layout using the [ ` repr ` attribute] ( #ffi-attributes ) .
11201120
11211121### Enumerations
@@ -2404,7 +2404,7 @@ items.
24042404
24052405An _ item declaration statement_ has a syntactic form identical to an
24062406[ item] ( #items ) declaration within a module. Declaring an item &mdash ; a
2407- function, enumeration, structure , type, static, trait, implementation or module
2407+ function, enumeration, struct , type, static, trait, implementation or module
24082408&mdash ; locally within a statement block is simply a way of restricting its
24092409scope to a narrow region containing all of its uses; it is otherwise identical
24102410in 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
25562556a 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
25582558can 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
25632563item] ( #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
25662566item.
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};
25812581some_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
25862586value.
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
25892589expression 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
25922592the same type as the base expression) with the given values for the fields that
25932593were explicitly specified and the values in the base expression for all other
25942594fields.
@@ -2634,7 +2634,7 @@ the left-hand-side expression is an indirect [trait object](#trait-objects).
26342634A _ field expression_ consists of an expression followed by a single dot and an
26352635identifier, 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}
26402640mystruct.myfield;
@@ -3353,17 +3353,17 @@ As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
33533353All in-bounds elements of arrays and slices are always initialized, and access
33543354to an array or slice is always bounds-checked.
33553355
3356- ### Structure types
3356+ ### Struct types
33573357
33583358A ` 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
33653365New instances of a ` struct ` can be constructed with a [ struct
3366- expression] ( #structure -expressions ) .
3366+ expression] ( #struct -expressions ) .
33673367
33683368The memory layout of a ` struct ` is undefined by default to allow for compiler
33693369optimizations like field reordering, but it can be fixed with the
@@ -3373,14 +3373,14 @@ have the same memory layout.
33733373
33743374The fields of a ` struct ` may be qualified by [ visibility
33753375modifiers] ( #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
33793379anonymous.
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
33843384type.
33853385
33863386### Enumerated types
@@ -3407,7 +3407,7 @@ named reference to an [`enum` item](#enumerations).
34073407### Recursive types
34083408
34093409Nominal 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 `
34113411constructor or ` struct ` field may refer, directly or indirectly, to the
34123412enclosing ` enum ` or ` struct ` type itself. Such recursion has restrictions:
34133413
0 commit comments