anoopelias opened issue #6796:
The sample code in Readme.md of
wasmtime
crate is not compiling.Steps to Reproduce
- Copy the code from this section of the Readme.md under
crates/wasmtime/Readme.md
- Paste it in a
main.rs
- Compile using
cargo run
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::<(), ()>
.
anoopelias added the bug label to Issue #6796.
jameysharp closed issue #6796:
The sample code in Readme.md of
wasmtime
crate is not compiling.Steps to Reproduce
- Copy the code from this section of the Readme.md under
crates/wasmtime/Readme.md
- Paste it in a
main.rs
- Compile using
cargo run
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