Skip to content

Restore trap if future.close-writable before future.write succeeds#521

Merged
lukewagner merged 1 commit intomainfrom
future-trap
May 29, 2025
Merged

Restore trap if future.close-writable before future.write succeeds#521
lukewagner merged 1 commit intomainfrom
future-trap

Conversation

@lukewagner
Copy link
Member

This PR re-adds the trapping condition that was accidentally removed in #489 to ensure that a future must successfully future.write a value before future.close-writableing, along with both WAST and Canonical ABI tests.

alexcrichton added a commit to alexcrichton/wit-bindgen that referenced this pull request May 27, 2025
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
github-merge-queue bot pushed a commit to bytecodealliance/wit-bindgen that referenced this pull request May 27, 2025
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
@lukewagner lukewagner force-pushed the future-trap branch 3 times, most recently from 6c94096 to 24cb4e2 Compare May 29, 2025 21:15
@lukewagner lukewagner merged commit a7029a6 into main May 29, 2025
2 checks passed
@lukewagner lukewagner deleted the future-trap branch May 29, 2025 21:19
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.

2 participants