Skip to main content

Module resolver

Module resolver 

Source

ModulesΒ§

errors πŸ”’
refinement_resolver πŸ”’

StructsΒ§

Ambiguity πŸ”’
A name that two competing glob imports bind to different items:
Binding πŸ”’
The value stored for each binding in a Rib. Lookups and clash detection are keyed by the name in the Rib’s map, so all a binding carries is where it came from, for diagnostics that point at the previous location of a name.
CrateResolver πŸ”’
DefinitionMap πŸ”’
Map to keep track of names defined in a scope
ItemResolver πŸ”’
Module πŸ”’
Akin to rustc_resolve::Module but specialized to what we support
NameResolution πŸ”’
All candidates for a single name in a single namespace, split into the two slots (non_glob_decl/glob_decl). The non-glob slot always wins.
Rib πŸ”’

EnumsΒ§

BindingSource πŸ”’
How a name was brought into a rib. Explicit definitions (items, generics, params, single uses, flux uses) shadow glob imports of the same name in the same namespace, regardless of declaration order; only globs can be ambiguous with each other.
GlobBinding πŸ”’
The glob-imported candidate(s) for a name, mirroring rustc’s glob_decl slot.
ModuleKind πŸ”’
Akin to rustc_resolve::ModuleKind but specialized to what we support
ResolveError πŸ”’
The reason a name lookup (resolve_ident_with_ribs, resolve_ident_in_module, resolve_path_with_ribs) failed.
RibKind πŸ”’

TraitsΒ§

Segment πŸ”’
Abstraction over a β€œsegment” so we can use CrateResolver::resolve_path_with_ribs with paths from different sources (e.g., surface::PathSegment, surface::ExprPathSegment)

FunctionsΒ§

builtin_types_rib πŸ”’
The Namespace::TypeNS prelude: builtin Rust types (bool, i32, str, …) together with the sort-only primitive sorts (int, real, Set, Map, ptr). Sorts and types share the type namespace; bool/char/str are resolved as fhir::Res::PrimTy and their sort is derived in conv_sort_path (see fhir::PrimSort).
is_prelude_import πŸ”’
Return true if the item has a #[prelude_import] annotation
mk_crate_mapping πŸ”’
module_children πŸ”’
resolve_crate πŸ”’
theory_funcs_rib πŸ”’
The Namespace::ReftNS prelude: theory functions and cast.
try_resolve_crate πŸ”’
visible_module_children πŸ”’
Iterator over module children visible form curr_mod

Type AliasesΒ§

Result πŸ”’