Skip to content

refactor(parser): remove orphaned DocEmitter::card_data_keyword and stale dead_code allows (U8)#5590

Merged
matthewevans merged 1 commit into
mainfrom
ship/u8-docemitter-orphan
Jul 11, 2026
Merged

refactor(parser): remove orphaned DocEmitter::card_data_keyword and stale dead_code allows (U8)#5590
matthewevans merged 1 commit into
mainfrom
ship/u8-docemitter-orphan

Conversation

@matthewevans

Copy link
Copy Markdown
Member

Two pieces of scaffolding left behind by the Milestone-1 parser refactor.

  • DocEmitter::card_data_keyword — zero callers. The card-data (MTGJSON) keyword path never routed through DocEmitter.
  • Two #[allow(dead_code)] on DocEmitter — they claimed the struct would be "wired by the dispatch-loop/preprocessor cutover in this unit." That cutover landed. DocEmitter is live, and the attributes were left behind suppressing warnings for code that is now used.

The two are linked: removing the orphan is what makes the allows unnecessary. With card_data_keyword gone, every remaining DocEmitter item has a caller.

Note on the burden of proof

These look like one task but need opposite evidence, which is why they're proven separately:

  • card_data_keyword is removable iff it has zero callers → proof is finding nothing.
  • An #[allow(dead_code)] is removable iff the item it covers DOES have callers → proof is finding something. Strip the attribute off something genuinely unused and you don't clean up, you convert a suppressed warning into a -D warnings build failure.

Callers were re-checked across #[cfg(test)] blocks, the other crates (engine-wasm, phase-ai, phase-server, mtgish-import), and feature-gated code — because an incomplete search is exactly how "dead code" that isn't dead gets deleted.

Context

From a wider audit of Milestone-1 scaffolding: of 11 items catalogued, only these 2 are removable. The other 9 have live callers or belong to later units (Plan 02 owns check_swallowed_clauses; U7 owns the patch_* passes; U6-C5/C6 own lower.rs's widened visibility). Useful to know before U8 is scoped as a deletion pass — it mostly isn't one.

…tale dead_code allows (U8)

card_data_keyword had zero callers: the card-data (MTGJSON) keyword path never
routed through DocEmitter. Its two #[allow(dead_code)] attributes claimed the
struct would be 'wired by the dispatch-loop/preprocessor cutover in this unit' —
that cutover landed, DocEmitter is live, and the attributes were left behind
suppressing warnings for code that is now used.

Removing the orphan makes the allows unnecessary, so both come off together:
with card_data_keyword gone, every remaining DocEmitter item has a caller.
@matthewevans
matthewevans enabled auto-merge July 11, 2026 16:41
@matthewevans
matthewevans added this pull request to the merge queue Jul 11, 2026
@github-actions

Copy link
Copy Markdown

Parse changes introduced by this PR

✓ No card-parse changes detected.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request cleans up unused code in crates/engine/src/parser/oracle.rs by removing the unused card_data_keyword method from DocEmitter and removing the #[allow(dead_code)] attributes from the DocEmitter struct and its implementation block. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Merged via the queue into main with commit cefb614 Jul 11, 2026
13 checks passed
@matthewevans
matthewevans deleted the ship/u8-docemitter-orphan branch July 11, 2026 17:04
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