Skip to content

compiler: per-enum allow(dead_code) for HIR/FPGA grammar enums (warnings 655->647). Closes #1129#1132

Merged
gHashTag merged 1 commit into
masterfrom
loop9-s-hir-deadcode-slice
Jun 14, 2026
Merged

compiler: per-enum allow(dead_code) for HIR/FPGA grammar enums (warnings 655->647). Closes #1129#1132
gHashTag merged 1 commit into
masterfrom
loop9-s-hir-deadcode-slice

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Summary

Targeted dead-code slice (part of the #969 warnings-baseline effort): annotate the
spec-complete HIR/FPGA grammar enums in bootstrap/src/compiler.rs with a per-enum
#[allow(dead_code)] so the build stops emitting "variants never constructed" warnings
for an intentionally-broad AST surface, and lower the recorded warnings baseline 655 -> 647.

Motivation

The "Hardware IR (HIR) -- Phase 0 FPGA foundation" section defines a deliberately
spec-complete set of grammar enums. Several of their variants are not yet constructed by
the current lowering path, which is expected at this phase -- the AST surface is intentionally
wider than today's consumers. These show up as 8 dead_code warnings that are pure noise:
they do not indicate a bug, and the variants are part of the documented spec, not accidental.

This is the same conservative, per-item pattern used in #1111 and #1122: we annotate the
specific enums (NOT the whole file, NOT a crate-level allow), with a comment explaining the
intent, so the suppression stays scoped and reviewable.

Scope (exactly 8 enums, HIR/FPGA section)

HwType, HwResetKind, HwResetPolarity, HwEdge, HirAlwaysStmtKind, HwMemKind,
HwCrossStrategy, HwFifoKind.

Each gets a #[allow(dead_code)] between its #[derive(...)] and pub enum (valid Rust;
keeps the diff minimal). The first enum is preceded by a short comment block explaining this
is an intentionally spec-complete AST surface, annotated per-enum rather than file-level.

Effect

  • Build warnings: 655 -> 647 (8 variants never constructed warnings removed).
  • scripts/warnings-baseline.sh baseline updated 655 -> 647 with a history note.
  • No behavior change: #[allow(dead_code)] only suppresses the lint; no code is added,
    removed, or rewired. Full test suite unaffected.

Verification

  • cargo build --bin t27c -> 647 warnings (was 655).
  • make warnings-baseline -> OK (647 <= 647).
  • Full suite green, 0 regressions.

L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality
claim added.

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-06-14 17:29:45 UTC

Summary

Status Count
Total Open PRs 2
PRs with Failing Checks 0
PRs with All Checks Green 2
READY 1
FAILING 0
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=5145e9bd1f3c != manifest seal=49e55df6d444.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 61cfe6d into master Jun 14, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant