11# Names
22
3- Entities declare a * name * to refer to that entity. Some entities are
4- [ explicitly declared ] ( #explicit-entities ) in the source code, and some are
5- [ implicitly declared ] ( #implicit-entities ) as part of the language or compiler
6- extensions .
3+ An * entity * is a language construct that can be referred to in some way within
4+ the source program, usually via a [ * path * ] . Entities include [ types ] , [ items ] ,
5+ [ generic parameters ] , [ variable bindings ] , [ loop labels ] , [ lifetimes ] ,
6+ [ fields ] , [ attributes ] , and [ lints ] .
77
8- Entity names are valid within a [ * scope* ] — a region of source text where that
9- name may be referenced.
8+ A * declaration* is a syntactical construct that can introduce a * name* to
9+ refer to an entity. Entity names are valid within a [ * scope* ] — a region of
10+ source text where that name may be referenced.
11+
12+ Some entities are [ explicitly declared] ( #explicit-entities ) in the source
13+ code, and some are [ implicitly declared] ( #implicit-entities ) as part of the
14+ language or compiler extensions.
1015
1116[ * Paths* ] are used to refer to an entity, possibly in another scope. Lifetimes
1217and loop labels use a [ dedicated syntax] [ lifetimes-and-loop-labels ] using a
@@ -75,16 +80,16 @@ introduced by compiler options and extensions:
7580* The [ ` 'static ` ] lifetime
7681
7782Additionally, the crate root module does not have a name, but can be referred
78- to with certain [ path qualifiers] .
83+ to with certain [ path qualifiers] or aliases .
7984
8085
8186[ *Name resolution* ] : names/name-resolution.md
8287[ *namespaces* ] : names/namespaces.md
88+ [ *path* ] : paths.md
8389[ *paths* ] : paths.md
8490[ *scope* ] : names/scopes.md
8591[ *visibility* ] : visibility-and-privacy.md
8692[ `'static` ] : keywords.md#weak-keywords
87- [ path qualifiers ] : paths.md#path-qualifiers
8893[ `for` ] : expressions/loop-expr.md#iterator-loops
8994[ `if let` ] : expressions/if-expr.md#if-let-expressions
9095[ `let` statement ] : statements.md#let-statements
@@ -105,6 +110,7 @@ to with certain [path qualifiers].
105110[ extern-prelude ] : names/preludes.md#extern-prelude
106111[ External block items ] : items/external-blocks.md
107112[ External crate declarations ] : items/extern-crates.md
113+ [ fields ] : expressions/field-expr.md
108114[ floating-point types ] : types/numeric.md#floating-point-types
109115[ Function declarations ] : items/functions.md
110116[ function parameters ] : items/functions.md#function-parameters
@@ -115,12 +121,14 @@ to with certain [path qualifiers].
115121[ Items ] : items.md
116122[ Language prelude ] : names/preludes.md#language-prelude
117123[ lifetimes-and-loop-labels ] : tokens.md#lifetimes-and-loop-labels
124+ [ lifetimes ] : tokens.md#lifetimes-and-loop-labels
118125[ Lints ] : attributes/diagnostics.md#lint-check-attributes
119126[ Loop labels ] : expressions/loop-expr.md#loop-labels
120127[ Machine-dependent integer types ] : types/numeric.md#machine-dependent-integer-types
121128[ macro invocations ] : macros.md#macro-invocation
122129[ matcher metavariables ] : macros-by-example.md#metavariables
123130[ Module declarations ] : items/modules.md
131+ [ path qualifiers ] : paths.md#path-qualifiers
124132[ Standard library prelude ] : names/preludes.md#standard-library-prelude
125133[ Static item declarations ] : items/static-items.md
126134[ struct ] : items/structs.md
@@ -129,5 +137,7 @@ to with certain [path qualifiers].
129137[ tool lint attributes ] : attributes/diagnostics.md#tool-lint-attributes
130138[ Trait item declarations ] : items/traits.md
131139[ Type aliases ] : items/type-aliases.md
140+ [ types ] : types.md
132141[ union ] : items/unions.md
133142[ Use declarations ] : items/use-declarations.md
143+ [ variable bindings ] : patterns.md
0 commit comments