@@ -61,6 +61,13 @@ through a mechanism called ‘trait objects’.
61
61
62
62
A dynamically sized type (DST) is a type without a statically known size or alignment.
63
63
64
+ ### Entity
65
+
66
+ An [ * entity* ] is a language construct that can be referred to in some way
67
+ within the source program, usually via a [ path] [ paths ] . Entities include
68
+ [ types] , [ items] , [ generic parameters] , [ variable bindings] , [ loop labels] ,
69
+ [ lifetimes] , [ fields] , [ attributes] , and [ lints] .
70
+
64
71
### Expression
65
72
66
73
An expression is a combination of values, constants, variables, operators
@@ -123,6 +130,28 @@ This is not affected by applied type arguments. `struct Foo` is considered local
123
130
` Vec<Foo> ` is not. ` LocalType<ForeignType> ` is local. Type aliases do not
124
131
affect locality.
125
132
133
+ ### Name
134
+
135
+ A [ * name* ] is an [ identifier] or [ lifetime or loop label] that refers to an
136
+ [ entity] ( #entity ) . A * name binding* is when an entity declaration introduces
137
+ an identifier or label associated with that entity. [ Paths] ,
138
+ identifiers, and labels are used to refer to an entity.
139
+
140
+ ### Name resolution
141
+
142
+ [ * Name resolution* ] is the compile-time process of tying [ paths] ,
143
+ [ identifiers] , and [ labels] to [ entity] ( #entity ) declarations.
144
+
145
+ ### Namespace
146
+
147
+ A * namespace* is a logical grouping of declared [ names] ( #name ) based on the
148
+ kind of [ entity] ( #entity ) the name refers to. Namespaces allow the occurrence
149
+ of a name in one namespace to not conflict with the same name in another
150
+ namespace.
151
+
152
+ Within a namespace, names are organized in a hierarchy, where each level of
153
+ the hierarchy has its own collection of named entities.
154
+
126
155
### Nominal types
127
156
128
157
Types that can be referred to by a path directly. Specifically [ enums] ,
@@ -133,11 +162,22 @@ Types that can be referred to by a path directly. Specifically [enums],
133
162
[ Traits] that can be used as [ trait objects] . Only traits that follow specific
134
163
[ rules] [ object safety ] are object safe.
135
164
165
+ ### Path
166
+
167
+ A [ * path* ] is a sequence of one or more path segments used to refer to an
168
+ [ entity] ( #entity ) in the current scope or other levels of a
169
+ [ namespace] ( #namespace ) hierarchy.
170
+
136
171
### Prelude
137
172
138
173
Prelude, or The Rust Prelude, is a small collection of items - mostly traits - that are
139
174
imported into every module of every crate. The traits in the prelude are pervasive.
140
175
176
+ ### Scope
177
+
178
+ A [ * scope* ] is the region of source text where a named [ entity] ( #entity ) may
179
+ be referenced with that name.
180
+
141
181
### Scrutinee
142
182
143
183
A scrutinee is the expression that is matched on in ` match ` expressions and
@@ -216,17 +256,37 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia
216
256
217
257
[ alignment ] : type-layout.md#size-and-alignment
218
258
[ associated item ] : #associated-item
259
+ [ attributes ] : attributes.md
260
+ [ *entity* ] : names.md
219
261
[ enums ] : items/enumerations.md
262
+ [ fields ] : expressions/field-expr.md
220
263
[ free item ] : #free-item
264
+ [ generic parameters ] : items/generics.md
265
+ [ identifier ] : identifiers.md
266
+ [ identifiers ] : identifiers.md
221
267
[ implementation ] : items/implementations.md
222
268
[ implementations ] : items/implementations.md
223
269
[ inherent implementation ] : items/implementations.md#inherent-implementations
224
270
[ item ] : items.md
271
+ [ items ] : items.md
272
+ [ labels ] : tokens.md#lifetimes-and-loop-labels
273
+ [ lifetime or loop label ] : tokens.md#lifetimes-and-loop-labels
274
+ [ lifetimes ] : tokens.md#lifetimes-and-loop-labels
275
+ [ lints ] : attributes/diagnostics.md#lint-check-attributes
276
+ [ loop labels ] : tokens.md#lifetimes-and-loop-labels
225
277
[ method ] : items/associated-items.md#methods
278
+ [ *Name resolution* ] : names/name-resolution.md
279
+ [ *name* ] : names.md
280
+ [ *namespace* ] : names/namespaces.md
226
281
[ never type ] : types/never.md
227
282
[ object safety ] : items/traits.md#object-safety
283
+ [ *path* ] : paths.md
284
+ [ Paths ] : paths.md
285
+ [ *scope* ] : names/scopes.md
228
286
[ structs ] : items/structs.md
229
287
[ trait objects ] : types/trait-object.md
230
288
[ traits ] : items/traits.md
289
+ [ types ] : types.md
231
290
[ undefined-behavior ] : behavior-considered-undefined.md
232
291
[ unions ] : items/unions.md
292
+ [ variable bindings ] : patterns.md
0 commit comments