refactor(parser): remove orphaned DocEmitter::card_data_keyword and stale dead_code allows (U8)#5590
Merged
Merged
Conversation
…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
enabled auto-merge
July 11, 2026 16:41
Parse changes introduced by this PR✓ No card-parse changes detected. |
Contributor
There was a problem hiding this comment.
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.
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.
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 throughDocEmitter.#[allow(dead_code)]onDocEmitter— they claimed the struct would be "wired by the dispatch-loop/preprocessor cutover in this unit." That cutover landed.DocEmitteris 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_keywordgone, every remainingDocEmitteritem 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_keywordis removable iff it has zero callers → proof is finding nothing.#[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 warningsbuild 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 thepatch_*passes; U6-C5/C6 ownlower.rs's widened visibility). Useful to know before U8 is scoped as a deletion pass — it mostly isn't one.