Skip to content

store argument in wasmtime.bindgen output seems redundant #218

@whitequark

Description

@whitequark

When used with a component, wasmtime.bindgen will generate something like this:

import wasmtime

class Root:
    def __init__(self, store: wasmtime.Store) -> None:
        ...
    def render_json(self, caller: wasmtime.Store, json: str) -> str:
        ...

At first I thought that caller != store is a valid configuration but it's clearly not since it aborts:

thread '<unnamed>' panicked at crates/wasmtime/src/runtime/func.rs:875:9:
assertion failed: self.comes_from_same_store(store)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted

Why not capture the store then? It's annoying to have to thread it down into every call if there's only one valid value for it anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions