Skip to content

feat: project borrowed sum payloads in place - #857

Merged
sanohiro merged 2 commits into
mainfrom
agent/option-borrow-view
Aug 19, 2026
Merged

feat: project borrowed sum payloads in place#857
sanohiro merged 2 commits into
mainfrom
agent/option-borrow-view

Conversation

@sanohiro

@sanohiro sanohiro commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Project borrowed payload bindings from stable Option, Result, and user-defined sum places as checked HIR/MIR projections.
  • Carried projection provenance through escape analysis, move checking, replay validation, MIR lowering, and LLVM code generation.
  • Rejected unsupported or consuming uses explicitly and added owner regressions for direct, nested, mutable, imported, and malformed paths.

Why

This enables safe borrowed sum-payload access without creating initialized storage for a projection-only binding. The admissible payload grammar remains finite and fail-closed; unsupported owned payloads keep the existing diagnostic path.

Validation

  • scripts/cargo.sh test -p align_driver --test borrowed_params -- --nocapture (21 passed)
  • scripts/cargo.sh test -p align_sema borrowed_sum_match -- --nocapture (2 passed)
  • scripts/cargo.sh test -p align_mir validate_hir_tests::hir_body_validator_accepts_nested_tagged_payload_construction -- --nocapture
  • scripts/lint-ratchet.sh
  • scripts/pre-pr.sh --reviewer codex --findings-fixed ... (owner test, bounded gate, and Clippy passed)

The implementation follows docs/impl/26-borrowed-sum-projection-plan.md.

@sanohiro
sanohiro marked this pull request as ready for review August 19, 2026 05:16
@sanohiro
sanohiro merged commit 8557c15 into main Aug 19, 2026
6 of 7 checks passed
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