Skip to content

emitter(v1-seed): derive Debug/PartialEq/serde on phantom type-tag markers - #5400

Closed
gunbai-bot[bot] wants to merge 1 commit into
mainfrom
emitter/phantom-tag-derives
Closed

gunbai-bot[bot] wants to merge 1 commit into
mainfrom
emitter/phantom-tag-derives

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

What

Phantom type-tag markers — enum variants used as type-level kinds (the Quantity/Scale tags Memory/One/Power/Gibi/… in Measure<Memory, One, Nat>) — are emitted as bare unit structs (pub struct Memory;) with no derives. Give them the matching derive set via a single-authority helper rust_phantom_zst_marker_def, used by both the per-enum and per-module marker emitters.

Why

Any carrier that mentions a marker fails its own derive closed: Measure<Q,S,M> derives Debug/Clone/PartialEq + serde, which (via the derive macro's bounds) requires Q,S: Debug/PartialEq/…. With the markers underived, the seed gets E0277 (Memory doesn't implement Debug) and E0369 (== cannot be applied to a Measure).

Verification (2-stage proxy on the integration seed)

E0277 3 → 0 and E0369 2 → 0 (−5), no new error classes. The helper is confirmed emitted into the regenerated v1_compiler_emit_rust.rs (definition + both call sites).

Scope

.dag-only — committed seed unchanged, main keeps building. emitter-completeness slice, NOT seed-green; seed-green lands in #5325.

🤖 Generated with Claude Code

…rkers

Enum variants used as type-level kinds (the Quantity/Scale tags Memory/One/
Power/Gibi/... in Measure<Memory, One, Nat>) are emitted as bare unit structs
(`pub struct Memory;`) with no derives. Any carrier that mentions them then
fails its own derive closed: Measure<Q,S,M> derives Debug/Clone/PartialEq +
serde, which requires Q,S: those traits, so the seed gets E0277 (`Memory`
doesn't implement `Debug`) and E0369 (`==` cannot be applied to a Measure).

Give the markers the matching derive set (Debug, Clone, Copy, PartialEq, Eq,
serde::Serialize, serde::Deserialize) via a single-authority helper
`rust_phantom_zst_marker_def`, used by both the per-enum and per-module marker
emitters.

Verified by execution (2-stage proxy on the integration seed): E0277 3 -> 0 and
E0369 2 -> 0 (-5), no new error classes. Helper confirmed emitted into the
regenerated v1_compiler_emit_rust.rs.

emitter-completeness slice, NOT seed-green; seed-green lands in #5325.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor

Consolidated into #5413 (freeze consolidation of the durable gunbc lanes). Branch retained; reopen if the consolidation is unwound.

@briansrls briansrls closed this Jun 20, 2026
briansrls added a commit that referenced this pull request Jun 20, 2026
…) (#5413)

Consolidates the durable freeze lanes onto one branch (each constituent closed in favor of this):
- #5402 dsl_compile_clean dual-root gate-widen (Strategy A keystone)
- #5395 .length() -> .count() dissolution
- #5407 anemia CONFIRM eval corpus (additive)
- #5400 phantom type-tag derives
- #5396 Measure-alias count peel (E0560)

Plus a carried fix for a pre-existing main defect (from #5406): clippy::manual_is_multiple_of +
fmt in v2_whole_tree_parse_scan.rs (main's rust_monolith gate is skipped on main pushes, so it
went uncaught; this is the first post-#5406 PR to touch a .rs and run clippy against it).

Local receipt: cargo fmt --all --check clean; cargo clippy --all-targets -- -D warnings exit 0;
cargo test -p v1-compiler-tests interp_recorded_fixture/wet_hermetic/resolve_expr_types_retraversal
= 28 passed, 0 failed. All other floor gates (dsl_compile_clean, source_root_ingest, emit_host,
layering, 557-witness corpus) were green on the prior runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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