Skip to content

engine: many allow(dead_code) annotations may hide unused code #424

Open

Description

@bpowers

src/simlin-engine/src/ has about 40 #[allow(dead_code)] annotations.
Some are legitimate, but others hide code that is really unused in production or used only by tests.
Each should be resolved one of three ways:

  • used in production in a way the compiler cannot see: keep the allow, with a comment saying why;
  • used only by tests: replace with #[cfg(test)];
  • unused: delete it.

Examples

grep -rn 'allow(dead_code' src/simlin-engine/src/ lists them.
Likely candidates include get_var_loc in ast/mod.rs and ast/expr2.rs, the "used in pass 2" methods in ast/expr3.rs, units.rs const_int_eval, ai_info.rs ai_state_to_letter, datamodel.rs UnitMap::pretty_print, the unused fields in wasmgen/lower.rs and vdf/record_results.rs, and the whole compiler/expr.rs Expr enum (allowed at the type level, which can hide unused variants).

Fix

A one-pass cleanup; a few hours.

Activity

  1. added
    engine
    hygiene
    on Jun 8, 2026
  2. changed the title [-]engine: audit and clean up #[allow(dead_code)] annotations[/-] [+]engine: many allow(dead_code) annotations may hide unused code[/+] on Oct 12, 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

    enginehygiene

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions