Skip to content

engine: audit and clean up #[allow(dead_code)] annotations #424

Description

@bpowers

After the interpreter removal (#420), several #[allow(dead_code)] annotations remain in src/simlin-engine/src/. Some are correct (fields set by production struct literals but only read in tests), but others may be masking genuinely dead code that should be deleted or gated with #[cfg(test)].

A cleanup pass should:

  1. grep -rn '#\[allow(dead_code)\]' src/simlin-engine/src/ to enumerate all annotations
  2. For each, determine whether the item is:
    • Production code that clippy can't trace (e.g. salsa dispatch, struct fields set via literals) -- keep #[allow(dead_code)] with a comment explaining why
    • Test-only code -- change to #[cfg(test)] so it's excluded from the production binary
    • Genuinely dead -- delete it
  3. Remove any #[allow(dead_code)] that was added defensively during the interpreter removal without verifying the item's actual usage

Known items from #420 review:

  • compiler/mod.rs: Module struct fields runlist_initials, runlist_order, module_refs -- set by production code but only read in tests
  • compiler/expr.rs: SubscriptIndex::strip_loc(), Expr::strip_loc()
  • ast/expr2.rs: IndexExpr2::get_var_loc(), Expr2::get_var_loc() -- called via salsa dispatch
  • ast/mod.rs: Ast<Expr2>::get_var_loc() -- called via salsa dispatch
  • ast/array_view.rs: ArrayView::is_contiguous()

Activity

  1. added
    engineIssues with the rust-based simulation engine
    hygieneToil, but its useful to get get too behind on it
    on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineIssues with the rust-based simulation enginehygieneToil, but its useful to get get too behind on it

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions