From 902cef083e947bfdf4d1f8c326b4eb2abdcfc80b Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 5 May 2021 11:08:06 -0700 Subject: [PATCH 1/3] Add "crate" to glossary. --- src/glossary.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/glossary.md b/src/glossary.md index f88ba2f0f..15d420c5f 100644 --- a/src/glossary.md +++ b/src/glossary.md @@ -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 @@ -274,6 +284,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 @@ -291,6 +302,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 @@ -303,6 +315,7 @@ 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 From 3f6cc4440962c7dedc26d6a939cbd82945c2d3e1 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 5 May 2021 11:15:52 -0700 Subject: [PATCH 2/3] Add "module" to glossary. --- src/glossary.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/glossary.md b/src/glossary.md index 15d420c5f..5fdc3fb29 100644 --- a/src/glossary.md +++ b/src/glossary.md @@ -140,6 +140,14 @@ This is not affected by applied type arguments. `struct Foo` is considered local `Vec` is not. `LocalType` 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 outside of a module, which +may be restricted by [visibility rules]. +[More][modules] + ### Name A [*name*] is an [identifier] or [lifetime or loop label] that refers to an @@ -320,3 +328,4 @@ example of an uninhabited type is the [never type] `!`, or an enum with no varia [undefined-behavior]: behavior-considered-undefined.md [unions]: items/unions.md [variable bindings]: patterns.md +[visibility rules]: visibility-and-privacy.md From e9862d82e92bb0d6f89df4036a98f96bcdd61c95 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 28 May 2021 15:49:44 -0700 Subject: [PATCH 3/3] Reword awkward sentence for module definition. --- src/glossary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glossary.md b/src/glossary.md index 5fdc3fb29..e345634a8 100644 --- a/src/glossary.md +++ b/src/glossary.md @@ -144,7 +144,7 @@ affect locality. 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 outside of a module, which +root module. [Paths] may be used to refer to items from other modules, which may be restricted by [visibility rules]. [More][modules]