Conversation
Code Review — PR #404: Multi-Capture Order FixOverviewThis PR fixes a correctness bug where closure captures with 2+ values arrived in the closure body in reversed caller order. The root cause was that The fix is a single Code QualityStrengths:
Issues1. Module comment inconsistency (closures.rs, lines 22–23) The module-level doc still lists Variant as a type "to be added in future PR": But 2. Missing 3-capture ordering test
3. The achieves "peek into aux without consuming it," but this idiom isn't obvious. A brief inline comment like 4. PR title and description The commit message and PR title are both just 5. Checkpoint 7 mentions Test Coverage
SummaryThe fix is correct and well-reasoned. The main asks before merge:
The code change itself ( |
┌─────┬─────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ # │ Reviewer point │ Action │ ├─────┼─────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 1 │ closures.rs module comment still lists │ Fixed — comment now notes Variant shipped in PR #402 via generic env_push_value path │ │ │ Variant as "to be added" │ │ ├─────┼─────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 2 │ No 3-capture ordering test │ Added test-fold-capture-three-ints — position-encodes a*100 + b*10 + c, distinguishes all 6 │ │ │ │ permutations of (1,2,3), asserts 492 (= 123 × 4 iters) │ ├─────┼─────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 3 │ Dense aux> dup >aux idiom │ Annotated — replaced the blank comment with "peek: restore int_cap, keep copy in aux" │ ├─────┼─────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 4 │ PR/commit title is just "rev" │ Flagged for you — your call whether to amend or rename the PR. Suggestion: fix(closures): preserve │ │ │ │ caller stack order for multi-value captures (breaking, 5.5) │ ├─────┼─────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 5 │ Design doc referenced my internal │ Scrubbed — replaced memory/feedback_capture_order.md mentions in CAPTURE_ORDER_FIX.md with │ │ │ memory file │ references to MIGRATION_5.5.md │ └─────┴─────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────┘ Nothing committed — the four code/doc changes are in the working tree ready for you to review and amend/commit to PR #404.
Code Review — PR #404: Multi-capture closure ordering fixOverviewThis PR fixes a two-part bug in multi-value closure capture ordering:
Fix: One line — Strengths
Issues and SuggestionsMinor:
|
No description provided.