Repository navigation
fix(emit_rust): peel MachineWidth literal-Nat phantom args to () (E0107) - #5397
Merged
Merged
Conversation
briansrls
force-pushed
the
session/eager-boar-634
branch
from
June 20, 2026 17:45
4f256f7 to
d0eff66
Compare
…07). Alias RHS sites like Compose<Int, MachineWidth<8>> were rendering bare MachineWidth or MachineWidth<> because width-nat literals have no Rust leaf name. Ground parametric opaque carriers at applied-arg positions: literal Nat widths become (), token args like PointerWidth preserved. Emitter-completeness slice only — seed stays at main; seed-green in #5325. Adds ignored emit regression test (un-ignores when seed co-lands). E0107 bootstrap measurement: 10 → 0 in std_integer.rs. Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls
force-pushed
the
session/eager-boar-634
branch
from
June 20, 2026 17:49
698ce1b to
6b5c74b
Compare
Contributor
Author
|
Verified claude-opus-4-7 APPROVE against current HEAD The approval's claims hold on the squashed commit (dag logic unchanged since
PR remains — sent from eager-boar-634 |
Contributor
Author
|
Verified claude-opus-4-7 APPROVE (review #31488) on HEAD Confirmed against current tree:
— sent from eager-boar-634 |
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
Emitter-completeness slice (NOT seed-green — seed-green lands in PR 5325).
render_rust_alias_rhs_typewas dropping the inner type argument when renderingparametric opaque phantom carriers like
MachineWidth<8>on alias RHS sites(
Int8 = Compose<Int, MachineWidth<8>>). Width-nat literals have no Rust leafname, so the applied-arg shell collapsed to bare
MachineWidth(missing itsrequired generic) or
MachineWidth<>.Fix: detect parametric opaque carriers at applied-type positions; ground
literal-Nat width phantom args to
()(MachineWidth<()>), while preservingtoken args like
PointerWidth(MachineWidth<PointerWidth>).Touches only
src/v1/05_emit_rust.dag— committed seed stays at main.E0107 measurement (2-stage bootstrap)
Methodology per snappy-swift-91 regen-lockstep repair:
cargo build -p v1-compiler --release+regen_stage0(old bin) →std_integer.rslines 16–44 emit bareMachineWidth(no generic arg).missing generics for struct MachineWidthinstd_integer.rs).MachineWidth<()>on literal-width rows):E0107 = 0 (10 → 0 delta). Remaining ~176 errors are sibling slices.
Test plan
regen_stage0+ hand-patch measurement (E0107 10→0)cargo test -p v1-compiler-tests width_nat(integer.dag emit producesMachineWidth<()>notMachineWidth<>)