Skip to content

feat(codegen): gen-rust tuple literals + let (a,b) destructuring - #1716

Merged
gHashTag merged 1 commit into
masterfrom
feat/tuple-destructure
Aug 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
feat/tuple-destructure

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Completes gen-rust tuple support (part 2 of #1702, after return-type #1709/#1710).

Tuple literals (a, b) in returns and let (s, d) = call() destructuring now emit valid Rust — previously they collapsed to unimplemented!() / let ;:

pub fn dm(a: u32, b: u32) -> (u32, u32) { return ((a + b), (a - b)); }
pub fn use_it(a: u32, b: u32) -> u32 { let (s, d) = dm(a, b); return (s + d); }

Adds NodeKind::ExprTuple (parsed when a comma follows in the ( primary), a tuple-pattern branch in parse_local_decl (extra_field), an optimizer guard keeping tuple-destructuring locals, and gen-rust emit for both.

Verified: new test test_tuple_literal_and_destructuring_rust, generated Rust rustc-compiles, full suite 1497/0, non-tuple specs unaffected, FROZEN_HASH re-sealed. Verilog/C tuple lowering still TODO.

Closes #1715

Adds NodeKind::ExprTuple (parsed when a comma follows in the '(' primary), a
tuple-pattern branch in parse_local_decl (stored in extra_field), an optimizer
guard keeping tuple-destructuring locals, and gen-rust emit for '(e0, e1)' and
'let (a, b) = init'. Tuple specs now rustc-compile end-to-end.

Regression test test_tuple_literal_and_destructuring_rust; full suite 1497/0;
FROZEN_HASH re-sealed. Part 2 of tuple support (#1702); Verilog/C TODO.

Closes #1715
@gHashTag
gHashTag enabled auto-merge August 5, 2026 15:12
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-05 15:12:42 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 0
PRs with All Checks Green 50
READY 0
FAILING 0
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=2d93a092c0c9 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

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.

codegen: gen-rust tuple support — literals + let (a,b) destructuring

1 participant