Skip to main content

Module lexical

Module lexical 

Source
Expand description

Lexical binding and capture analysis shared by compiler and typechecker.

AST visitors answer structural questions. Capture analysis is different: an identifier only captures a binding when it resolves outside the callable that contains the reference. Keeping that resolution here avoids each consumer inventing a slightly different notion of scope and shadowing.

Structs§

BindingId
Stable identity for a source binding. Patterns do not carry individual spans, so the declaration span plus the bound name is the narrowest source identity available without changing the AST.
MatchPatternCatalog
Compiler-resolved enum metadata needed to distinguish call-shaped enum patterns from ordinary expression-equality patterns.

Enums§

BareVariantResolution
Resolution of a bare call-shaped match pattern such as Ok(value). Compiler lowering and lexical analysis share this decision so a pattern cannot bind payload names in one subsystem and act as an expression in the other.

Functions§

ambiguous_bare_variant_message
binding_pattern_ids
Return the source identities introduced by pattern at declaration.
binding_pattern_names
Return every name introduced by a destructuring pattern, in source order. The projection is intentionally shared by the compiler and typechecker.
captured_bindings_in_compiled_module
Bindings captured under module execution order.
captured_bindings_in_nested_callables
Bindings in the current compiled body referenced by a nested callable.
captured_bindings_in_pipeline_lineage
Bindings captured across one pipeline inheritance chain.
is_deferred_module_declaration
Whether module compilation defers this declaration until after executable top-level statements. Capture analysis and bytecode lowering share this predicate so their visibility phases cannot drift.
module_scope_node_slices
Node slices whose declarations are predeclared in the module type scope.
nested_callable_reassigned_names
Names reassigned by a nested callable that are free relative to the current callable body. Type-flow narrowing uses this conservative summary: unknown names remain included so parameter captures continue to invalidate their narrowing at the caller-owned scope.
resolve_bare_variant_owners