r[names]
r[names.intro] An entity is a language construct that can be referred to in some way within the source program, usually via a path. Entities include types, items, generic parameters, variable bindings, loop labels, lifetimes, fields, attributes, and lints.
r[names.decl] A declaration is a syntactical construct that can introduce a name to refer to an entity. Entity names are valid within a scope --- a region of source text where that name may be referenced.
r[names.explicit-decl] Some entities are explicitly declared in the source code, and some are implicitly declared as part of the language or compiler extensions.
r[names.path] Paths are used to refer to an entity, possibly in another module or type.
r[names.lifetime] Lifetimes and loop labels use a dedicated syntax using a leading quote.
r[names.namespace] Names are segregated into different namespaces, allowing entities in different namespaces to share the same name without conflict.
r[names.resolution] Name resolution is the compile-time process of tying paths, identifiers, and labels to entity declarations.
r[names.visibility] Access to certain names may be restricted based on their visibility.
r[names.explicit]
r[names.explicit.list] Entities that explicitly introduce a name in the source code are:
r[names.explicit.item-decl]
macro_rules
declarations and matcher metavariablesr[names.explicit.expr]
r[names.explicit.generics]
r[names.explicit.higher-ranked-bounds]
r[names.explicit.binding]
let
statement pattern bindingsr[names.explicit.macro_use]
macro_use
attribute can introduce macro names from another crater[names.explicit.macro_export]
macro_export
attribute can introduce an alias for the macro into the crate rootr[names.explicit.macro-invocation] Additionally, macro invocations and attributes can introduce names by expanding to one of the above items.
r[names.implicit]
r[names.implicit.list] The following entities are implicitly defined by the language, or are introduced by compiler options and extensions:
r[names.implicit.primitive-types]
bool
char
and str
i8
, i16
, i32
, i64
, i128
, u8
, u16
, u32
, u64
, u128
usize
and isize
f32
and f64
r[names.implicit.builtin-attributes]
r[names.implicit.prelude]
r[names.implicit.stdlib]
r[names.implicit.extern-prelude]
r[names.implicit.tool-attributes]
r[names.implicit.lints]
r[names.implicit.derive-helpers]
r[names.implicit.lifetime-static]
'static
lifetimer[names.implicit.root] Additionally, the crate root module does not have a name, but can be referred to with certain path qualifiers or aliases.