Skip to content

Commit

Permalink
Merge pull request #1016 from ehuss/glossary-crate
Browse files Browse the repository at this point in the history
Add crate and module to glossary.
  • Loading branch information
matthewjasper authored Jun 1, 2021
2 parents 7453463 + e9862d8 commit 8f598e2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ Combinators are higher-order functions that apply only functions and
earlier defined combinators to provide a result from its arguments.
They can be used to manage control flow in a modular fashion.

### Crate

A crate is the unit of compilation and linking. There are different [types of
crates], such as libraries or executables. Crates may link and refer to other
library crates, called external crates. A crate has a self-contained tree of
[modules], starting from an unnamed root module called the crate root. [Items]
may be made visible to other crates by marking them as public in the crate
root, including through [paths] of public modules.
[More][crate].

### Dispatch

Dispatch is the mechanism to determine which specific version of code is actually
Expand Down Expand Up @@ -130,6 +140,14 @@ This is not affected by applied type arguments. `struct Foo` is considered local
`Vec<Foo>` is not. `LocalType<ForeignType>` is local. Type aliases do not
affect locality.

### Module

A module is a container for zero or more [items]. Modules are organized in a
tree, starting from an unnamed module at the root called the crate root or the
root module. [Paths] may be used to refer to items from other modules, which
may be restricted by [visibility rules].
[More][modules]

### Name

A [*name*] is an [identifier] or [lifetime or loop label] that refers to an
Expand Down Expand Up @@ -274,6 +292,7 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia
[associated item]: #associated-item
[attributes]: attributes.md
[*entity*]: names.md
[crate]: crates-and-source-files.md
[enums]: items/enumerations.md
[fields]: expressions/field-expr.md
[free item]: #free-item
Expand All @@ -291,6 +310,7 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia
[lints]: attributes/diagnostics.md#lint-check-attributes
[loop labels]: tokens.md#lifetimes-and-loop-labels
[method]: items/associated-items.md#methods
[modules]: items/modules.md
[*Name resolution*]: names/name-resolution.md
[*name*]: names.md
[*namespace*]: names/namespaces.md
Expand All @@ -303,7 +323,9 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia
[trait objects]: types/trait-object.md
[traits]: items/traits.md
[turbofish test]: https://github.com/rust-lang/rust/blob/master/src/test/ui/bastion-of-the-turbofish.rs
[types of crates]: linkage.md
[types]: types.md
[undefined-behavior]: behavior-considered-undefined.md
[unions]: items/unions.md
[variable bindings]: patterns.md
[visibility rules]: visibility-and-privacy.md

0 comments on commit 8f598e2

Please sign in to comment.