Stream: git-wasmtime

Topic: wasmtime / issue #6796 Sample code in Readme.md of wasmti...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2023 at 06:46):

anoopelias opened issue #6796:

The sample code in Readme.md of wasmtime crate is not compiling.

Steps to Reproduce

Expected Results

The code gets compiled and results get printed.

Actual Results

Compilation error,

error[E0107]: method takes 2 generic arguments but 3 generic arguments were supplied
   --> src/main.rs:31:26
    |
31  |     let hello = instance.get_typed_func::<(), (), _>(&mut store, "hello")?;
    |                          ^^^^^^^^^^^^^^           - help: remove this generic argument
    |                          |
    |                          expected 2 generic arguments
    |
note: method defined here, with 2 generic parameters: `Params`, `Results`
   --> /Users/xyz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-11.0.1/src/instance.rs:455:12
    |
455 |     pub fn get_typed_func<Params, Results>(
    |            ^^^^^^^^^^^^^^ ------  -------
    = note: `impl Trait` cannot be explicitly specified as a generic argument

Versions and Environment

Wasmtime version or commit: Current tip of the main 615d697a0ba11df4fccf36fefa29d0fc42c270641

Additional Information

This is a simple issue, should work if we remove the third generic argument and keep it as instance.get_typed_func::<(), ()>.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2023 at 06:46):

anoopelias added the bug label to Issue #6796.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2023 at 17:27):

jameysharp closed issue #6796:

The sample code in Readme.md of wasmtime crate is not compiling.

Steps to Reproduce

Expected Results

The code gets compiled and results get printed.

Actual Results

Compilation error,

error[E0107]: method takes 2 generic arguments but 3 generic arguments were supplied
   --> src/main.rs:31:26
    |
31  |     let hello = instance.get_typed_func::<(), (), _>(&mut store, "hello")?;
    |                          ^^^^^^^^^^^^^^           - help: remove this generic argument
    |                          |
    |                          expected 2 generic arguments
    |
note: method defined here, with 2 generic parameters: `Params`, `Results`
   --> /Users/xyz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-11.0.1/src/instance.rs:455:12
    |
455 |     pub fn get_typed_func<Params, Results>(
    |            ^^^^^^^^^^^^^^ ------  -------
    = note: `impl Trait` cannot be explicitly specified as a generic argument

Versions and Environment

Wasmtime version or commit: Current tip of the main 615d697a0ba11df4fccf36fefa29d0fc42c270641

Additional Information

This is a simple issue, should work if we remove the third generic argument and keep it as instance.get_typed_func::<(), ()>.


Last updated: Dec 23 2024 at 12:05 UTC