@@ -50,6 +50,16 @@ Combinators are higher-order functions that apply only functions and
50
50
earlier defined combinators to provide a result from its arguments.
51
51
They can be used to manage control flow in a modular fashion.
52
52
53
+ ### Crate
54
+
55
+ A crate is the unit of compilation and linking. There are different [ types of
56
+ crates] , such as libraries or executables. Crates may link and refer to other
57
+ library crates, called external crates. A crate has a self-contained tree of
58
+ [ modules] , starting from an unnamed root module called the crate root. [ Items]
59
+ may be made visible to other crates by marking them as public in the crate
60
+ root, including through [ paths] of public modules.
61
+ [ More] [ crate ] .
62
+
53
63
### Dispatch
54
64
55
65
Dispatch is the mechanism to determine which specific version of code is actually
@@ -130,6 +140,14 @@ This is not affected by applied type arguments. `struct Foo` is considered local
130
140
` Vec<Foo> ` is not. ` LocalType<ForeignType> ` is local. Type aliases do not
131
141
affect locality.
132
142
143
+ ### Module
144
+
145
+ A module is a container for zero or more [ items] . Modules are organized in a
146
+ tree, starting from an unnamed module at the root called the crate root or the
147
+ root module. [ Paths] may be used to refer to items from other modules, which
148
+ may be restricted by [ visibility rules] .
149
+ [ More] [ modules ]
150
+
133
151
### Name
134
152
135
153
A [ * name* ] is an [ identifier] or [ lifetime or loop label] that refers to an
@@ -274,6 +292,7 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia
274
292
[ associated item ] : #associated-item
275
293
[ attributes ] : attributes.md
276
294
[ *entity* ] : names.md
295
+ [ crate ] : crates-and-source-files.md
277
296
[ enums ] : items/enumerations.md
278
297
[ fields ] : expressions/field-expr.md
279
298
[ free item ] : #free-item
@@ -291,6 +310,7 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia
291
310
[ lints ] : attributes/diagnostics.md#lint-check-attributes
292
311
[ loop labels ] : tokens.md#lifetimes-and-loop-labels
293
312
[ method ] : items/associated-items.md#methods
313
+ [ modules ] : items/modules.md
294
314
[ *Name resolution* ] : names/name-resolution.md
295
315
[ *name* ] : names.md
296
316
[ *namespace* ] : names/namespaces.md
@@ -303,7 +323,9 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia
303
323
[ trait objects ] : types/trait-object.md
304
324
[ traits ] : items/traits.md
305
325
[ turbofish test ] : https://github.com/rust-lang/rust/blob/master/src/test/ui/bastion-of-the-turbofish.rs
326
+ [ types of crates ] : linkage.md
306
327
[ types ] : types.md
307
328
[ undefined-behavior ] : behavior-considered-undefined.md
308
329
[ unions ] : items/unions.md
309
330
[ variable bindings ] : patterns.md
331
+ [ visibility rules ] : visibility-and-privacy.md
0 commit comments