@@ -131,7 +131,7 @@ A `struct` *type* is a heterogeneous product of other types, called the
131
131
or the * struct* types of the Lisp family.
132
132
133
133
New instances of a ` struct ` can be constructed with a [ struct
134
- expression] ( #struct-expressions ) .
134
+ expression] ( expressions.html #struct-expressions) .
135
135
136
136
The memory layout of a ` struct ` is undefined by default to allow for compiler
137
137
optimizations like field reordering, but it can be fixed with the
@@ -140,37 +140,37 @@ a corresponding struct *expression*; the resulting `struct` value will always
140
140
have the same memory layout.
141
141
142
142
The fields of a ` struct ` may be qualified by [ visibility
143
- modifiers] ( # visibility-and-privacy) , to allow access to data in a
143
+ modifiers] ( visibility-and-privacy.html ) , to allow access to data in a
144
144
struct outside a module.
145
145
146
146
A _ tuple struct_ type is just like a struct type, except that the fields are
147
147
anonymous.
148
148
149
149
A _ unit-like struct_ type is like a struct type, except that it has no
150
150
fields. The one value constructed by the associated [ struct
151
- expression] ( #struct-expressions ) is the only value that inhabits such a
151
+ expression] ( expressions.html #struct-expressions) is the only value that inhabits such a
152
152
type.
153
153
154
154
## Enumerated types
155
155
156
156
An * enumerated type* is a nominal, heterogeneous disjoint union type, denoted
157
- by the name of an [ ` enum ` item] ( #enumerations ) . [ ^ enumtype ]
157
+ by the name of an [ ` enum ` item] ( items.html #enumerations) . [ ^ enumtype ]
158
158
159
159
[ ^ enumtype ] : The ` enum ` type is analogous to a ` data ` constructor declaration in
160
160
ML, or a * pick ADT* in Limbo.
161
161
162
- An [ ` enum ` item] ( #enumerations ) declares both the type and a number of * variant
162
+ An [ ` enum ` item] ( items.html #enumerations) declares both the type and a number of * variant
163
163
constructors* , each of which is independently named and takes an optional tuple
164
164
of arguments.
165
165
166
166
New instances of an ` enum ` can be constructed by calling one of the variant
167
- constructors, in a [ call expression] ( #call-expressions ) .
167
+ constructors, in a [ call expression] ( expressions.html #call-expressions) .
168
168
169
169
Any ` enum ` value consumes as much memory as the largest variant constructor for
170
170
its corresponding ` enum ` type.
171
171
172
172
Enum types cannot be denoted * structurally* as types, but must be denoted by
173
- named reference to an [ ` enum ` item] ( #enumerations ) .
173
+ named reference to an [ ` enum ` item] ( items.html #enumerations) .
174
174
175
175
## Recursive types
176
176
@@ -180,7 +180,7 @@ constructor or `struct` field may refer, directly or indirectly, to the
180
180
enclosing ` enum ` or ` struct ` type itself. Such recursion has restrictions:
181
181
182
182
* Recursive types must include a nominal type in the recursion
183
- (not mere [ type definitions] ( grammar.html#type-definitions ) ,
183
+ (not mere [ type definitions] ( ../ grammar.html#type-definitions) ,
184
184
or other structural types such as [ arrays] ( #array-and-slice-types ) or [ tuples] ( #tuple-types ) ).
185
185
* A recursive ` enum ` item must have at least one non-recursive constructor
186
186
(in order to give the recursion a basis case).
@@ -222,7 +222,7 @@ varieties of pointer in Rust:
222
222
for example ` *const i32 ` means a raw pointer to a 32-bit integer.
223
223
Copying or dropping a raw pointer has no effect on the lifecycle of any
224
224
other value. Dereferencing a raw pointer or converting it to any other
225
- pointer type is an [ ` unsafe ` operation] ( # unsafe-functions) .
225
+ pointer type is an [ ` unsafe ` operation] ( unsafe-functions.html ) .
226
226
Raw pointers are generally discouraged in Rust code;
227
227
they exist to support interoperability with foreign code,
228
228
and writing performance-critical or low-level functions.
@@ -268,8 +268,8 @@ messages to indicate "the unique fn type for the function `foo`".
268
268
269
269
## Closure types
270
270
271
- A [ lambda expression] ( #lambda-expressions ) produces a closure value with
272
- a unique, anonymous type that cannot be written out.
271
+ A [ lambda expression] ( expressions.html #lambda-expressions) produces a closure
272
+ value with a unique, anonymous type that cannot be written out.
273
273
274
274
Depending on the requirements of the closure, its type implements one or
275
275
more of the closure traits:
0 commit comments