Skip to content

impl WasmTy for u32 and u64#1808

Merged
alexcrichton merged 2 commits into
bytecodealliance:masterfrom
leoyvens:impl-wasmty-for-u32-u64
Jun 4, 2020
Merged

impl WasmTy for u32 and u64#1808
alexcrichton merged 2 commits into
bytecodealliance:masterfrom
leoyvens:impl-wasmty-for-u32-u64

Conversation

@leoyvens
Copy link
Copy Markdown
Contributor

@leoyvens leoyvens commented Jun 3, 2020

Wasm integer types are sign agnostic, so if Rust i32 and i64 are WasmTy so should u32 and u64. The trait implentation is exactly the same between i/u32 and i/u64.

@github-actions github-actions Bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jun 3, 2020
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2020

Subscribe to Label Action

cc @peterhuene

Details This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton
Copy link
Copy Markdown
Member

Agreed these are good to have, thanks!

Some other items I think to take care of are:

  • Could these be written in terms of the i32/i64 impls to cut down on duplication?
  • Can documentation be added to Func::wrap about these types?
  • Can tests be added which exercise the presence of these impls?

@leoyvens
Copy link
Copy Markdown
Contributor Author

leoyvens commented Jun 3, 2020

@alexcrichton thanks for the review, I've addressed all points.

@alexcrichton
Copy link
Copy Markdown
Member

Looks great to me! As one final nit, there's a table under "Rust types will map to WebAssembly types as follows", mind adding the u32/u64 types there too?

@leoyvens
Copy link
Copy Markdown
Contributor Author

leoyvens commented Jun 3, 2020

@alexcrichton ah of course, I missed that. Updated it.

@alexcrichton alexcrichton merged commit cd4a441 into bytecodealliance:master Jun 4, 2020
@alexcrichton
Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants