abrown opened PR #5428 from wiggle-mutability to main:
Previously, all Wiggle-generated traits were generated with
&mut selfsignatures. With the addition of themutableconfiguration option tofrom_witx!andwasmtime_integration!, one can disable this, emitting instead traits that use&self(i.e.,mutable: false). This change is helpful for implementing wasi-threads: WASI implementations with interior mutability will now be able to communitcate this to their Wiggle-generated code.The other side of this change is the
get_cxclosure passed to Wiggle's generatedadd_to_linkerfunction. Whenmutabilityis set totrue(default), theget_cxfunction takes a&mutdata structure from the store and returns a corresponding&mutreference, usually to a field of the passed-in structure. Whenmutability: false, theget_cxclosure will still take a&mutdata structure but now will return a&reference.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
abrown has marked PR #5428 as ready for review.
abrown requested alexcrichton for a review on PR #5428.
alexcrichton submitted PR review.
abrown updated PR #5428 from wiggle-mutability to main.
abrown merged PR #5428.
Last updated: Dec 06 2025 at 06:05 UTC