compiler: per-enum allow(dead_code) for HIR/FPGA grammar enums (warnings 655->647). Closes #1129#1132
Merged
Merged
Conversation
…ngs 655->647). Closes #1129
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-06-14 17:29:45 UTC
Summary
Seal Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Targeted dead-code slice (part of the #969 warnings-baseline effort): annotate the
spec-complete HIR/FPGA grammar enums in
bootstrap/src/compiler.rswith a per-enum#[allow(dead_code)]so the build stops emitting "variants never constructed" warningsfor 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_codewarnings 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(...)]andpub 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
variants never constructedwarnings removed).scripts/warnings-baseline.shbaseline updated 655 -> 647 with a history note.#[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).L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality
claim added.