Crate rustc_resolve
source Β·Expand description
This crate is responsible for the part of name resolution that doesnβt require type checker.
Module structure of the crate is built here. Paths in macros, imports, expressions, types, patterns are resolved here. Label and lifetime names are resolved here as well.
Type-relative name resolution (methods, fields, associated items) happens in rustc_hir_analysis
.
Modules§
- build_
reduced_ πgraph After we obtain a fresh AST fragment from a macro, code in this module helps to integrate that fragment into the module structures that are already partially built. - check_
unused π - def_
collector π - diagnostics π
- errors π
- ident π
- imports πA bunch of methods and structures more or less related to resolving imports.
- late πβLate resolutionβ is the pass that resolves most of names in a crate beside imports and macros. It runs when the crate is fully expanded and its module structure is fully built. So it just walks through the crate and resolves all the expressions, types, etc.
- macros πA bunch of methods and structures more or less related to resolving macros and interface provided by
Resolver
to macro expander.
Structs§
- Ambiguity
Error π - Binding
Error π - Binding
Key πA key that identifies a binding in a givenModule
. - Derive
Data π - Extern
Prelude πEntry - Finalize π
- Macro
Data π - Module πAll modules are unique and allocated on a same arena, so we can use referential equality to compare them.
- Module
Data πOne node in the tree of modules. - Name
Binding πData Records a possibly-private value, type, or module definition. - Parent
Scope πEverything you need to know about a nameβs location to resolve it. Serves as a starting point for the scope visitor. This struct is currently used only for early resolution (imports and macros), but not for late resolution yet. - Privacy
Error π - The main resolver class.
- Nothing really interesting here; it just provides memory for the rest of the crate.
- Segment πA minimal representation of a path segment. We use this in resolve because we synthesize βpath segmentsβ which donβt have the rest of an AST or HIR
PathSegment
. - UseError π
Enums§
- Ambiguity
Error πMisc Miscellaneous bits of metadata for better ambiguity error reporting. - Ambiguity
Kind π - Builtin
Macro πState Used for better errors for E0773 - Determinacy π
- Impl
Trait πContext - Lexical
Scope πBinding An intermediate resolution result. - Module
Kind π - Module
OrUniform πRoot - Name
Binding πKind - Path
Result π - Resolution
Error π - Scope πA specific scope in which a name can be looked up. This enum is currently used only for early resolution (imports and macros), but not for late resolution yet.
- Scope
Set πNames from different contexts may want to visit different subsets of all specific scopes with different restrictions when looking up the resolution. This enum is currently used only for early resolution (imports and macros), but not for late resolution yet. - Used πUsed for tracking import use types which will be used for redundant import checking.
- VisResolution
Error π - Weak π
Statics§
- Raw content of Fluent resource for this crate, generated by
fluent_messages
macro, imported byrustc_driver
to include all cratesβ resources in one bundle.
Traits§
- ToName
Binding π
Functions§
- module_
to_ πstring A somewhat inefficient routine to obtain the name of a module. - names_
to_ πstring - path_
names_ πto_ string
Type Aliases§
- Name
Binding πAll name bindings are unique and allocated on a same arena, so we can use referential equality to compare them. - Res π
- Resolutions π