Skip to content

fix(SR-32): inner resource handle fixup for borrow<T> in list elements#37

Merged
avrabe merged 2 commits intomainfrom
fix/sr-32-inner-resource-fixup
Mar 17, 2026
Merged

fix(SR-32): inner resource handle fixup for borrow<T> in list elements#37
avrabe merged 2 commits intomainfrom
fix/sr-32-inner-resource-fixup

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 17, 2026

Converts borrow handles inside list elements after bulk copy. Promotes resource_borrow_in_record to runtime. 40/45 fixtures passing.

avrabe and others added 2 commits March 17, 2026 20:18
When list elements contain borrow<T> (e.g., list<record { thing: borrow<T> }>),
the adapter now converts each handle to its representation after bulk-copying
the list data to callee memory. This mirrors emit_inner_pointer_fixup but
for resource handles: load handle, call [resource-rep], store rep back.

Changes:
- parser.rs: element_inner_resources() recursively finds resource handles
  inside record/tuple types
- resolver.rs: CopyLayout::Elements gains inner_resources field
- adapter/mod.rs: inner_resource_fixups on AdapterOptions
- adapter/fact.rs: inner resource fixup loops in generate_memory_copy_adapter
  and generate_retptr_adapter

Promotes resource_borrow_in_record to runtime test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 4090cbb into main Mar 17, 2026
3 checks passed
@avrabe avrabe deleted the fix/sr-32-inner-resource-fixup branch March 17, 2026 19:35
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