Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive Copy on wasmtime::ValType #6138

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

jbourassa
Copy link
Contributor

ValType is small enough that it can be copiable. By making ValType Copy, Copy structs can have ValType fields in them.

The need for this came up in bytecodealliance/wasmtime-rb#158. By making ValType Copy, we could get rid of this workaround.

`ValType` is small enough that it can be copiable. Doing so means
Copy types can embed a `ValType` in them.

The need for this came up in this Wasmtime Ruby PR:
bytecodealliance/wasmtime-rb#158
@jbourassa jbourassa requested a review from a team as a code owner April 3, 2023 22:57
@jbourassa jbourassa requested review from pchickey and removed request for a team April 3, 2023 22:57
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Apr 3, 2023
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

Subscribe to Label Action

cc @peterhuene

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.

@pchickey pchickey added this pull request to the merge queue Apr 4, 2023
@bjorn3
Copy link
Contributor

bjorn3 commented Apr 4, 2023

Is this still possible once the gc proposal is implemented? Wouldn't this enum get variants that use heap allocated values to represent gc types? Types containing heap allocated values can't be Copy.

Merged via the queue into bytecodealliance:main with commit c35c047 Apr 4, 2023
@jbourassa jbourassa deleted the valtype-copy branch April 4, 2023 19:42
@fitzgen
Copy link
Member

fitzgen commented Apr 4, 2023

Probably it will get variants that are indices into ... somewhere.

@fitzgen
Copy link
Member

fitzgen commented Apr 4, 2023

We might have to remove Copy, but we can do that when we get to it.

@jbourassa
Copy link
Contributor Author

Understood. We'll use it while we can, and adjust our strategy if ever it gets dropped. Thanks folks!

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.

4 participants