pub struct EntryFnIndex<'a> { /* private fields */ }Expand description
Bare-name → &FnDef index for the entry module only.
§Why a typed wrapper instead of raw HashMap<String, &FnDef>?
Entry-only verify exception (epic #170 Phase 5 deferred follow-up):
every helper-law-hint and contextual-helper-hint walker in this
module operates exclusively on top-level entry fn defs, because
verify <name> parses name as a single source Ident (see
src/parser/blocks.rs::parse_verify). The parser does NOT accept
dotted verify targets, so dep-module fns are unreachable from the
verify-law surface today. Bare-name keying is therefore
identity-safe by the parser invariant.
The typed wrapper exists so any future change that tries to
thread dep-module fns through this surface trips the compiler: a
HashMap<String, &FnDef> from a dep module won’t coerce into
EntryFnIndex, forcing the contributor to confront the keying
question explicitly. When module-scoped verify ships, the right
migration is to drop this wrapper in favour of an FnId-keyed
view sourced from CodegenContext.resolved_program.
temporary-migration-bridge: deferred per epic #170 audit (no
live trigger today; documented in
project_phase_e_scope_b_deferred memory).
Implementations§
Source§impl<'a> EntryFnIndex<'a>
impl<'a> EntryFnIndex<'a>
Sourcepub fn from_entry_items(items: &'a [TopLevel]) -> Self
pub fn from_entry_items(items: &'a [TopLevel]) -> Self
Build the index by walking entry-scope TopLevel items.
Dep modules are intentionally NOT considered — see type doc.
Sourcepub fn get(&self, name: &str) -> Option<&&'a FnDef>
pub fn get(&self, name: &str) -> Option<&&'a FnDef>
Bare-name lookup. Safe by parser invariant — see type doc.
Sourcepub fn contains_key(&self, name: &str) -> bool
pub fn contains_key(&self, name: &str) -> bool
Existence check. Same identity contract as Self::get.