Skip to content

Support "linear writes" in Rust future bindings#1306

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:future-writer-always-writes
May 27, 2025
Merged

Support "linear writes" in Rust future bindings#1306
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:future-writer-always-writes

Conversation

@alexcrichton
Copy link
Member

To account for WebAssembly/wasip3-prototyping#172 and WebAssembly/component-model#521 the Rust bindings need to take into account that a future writer cannot be dropped without actually writing something. To model this futures now must be created with a thunk that creates the default value to be sent. This value is only used if another value was not otherwise written.

Closes #1304

To account for WebAssembly/wasip3-prototyping#172 and
WebAssembly/component-model#521 the Rust bindings need to take into
account that a future writer cannot be dropped without actually writing
something. To model this futures now must be created with a thunk that
creates the default value to be sent. This value is only used if another
value was not otherwise written.

Closes bytecodealliance#1304
@alexcrichton alexcrichton requested a review from dicej May 27, 2025 20:58
@alexcrichton
Copy link
Member Author

For now tests are "updated enough" to pass but I suspect that more tests will need to be updated once the host is also enforcing this. Notably I suspect some C tests will need to be updated.

@alexcrichton alexcrichton enabled auto-merge May 27, 2025 21:09
@alexcrichton alexcrichton added this pull request to the merge queue May 27, 2025
Merged via the queue into bytecodealliance:main with commit b98f2e8 May 27, 2025
19 checks passed
@alexcrichton alexcrichton deleted the future-writer-always-writes branch May 27, 2025 21:32
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.

Ensure FutureWriter always writes

2 participants