When I try to use wasmtime::component::bindgen's new named_imports option on an interface with a hyphen in it, I get an error.
A repro case is here: https://github.com/itowlson/implements-hyphen-test
-
The first commit in the repo defines an interface named myitf and bindgens a host for it, with a named_imports for the myitf interface.
-
The second commit changes the interface name to my-itf with a hyphen (no other changes except propagating the name change). The bindgen now fails with the error:
error: expected one of `;` or `{`, found `-`
--> src/main.rs:2:5
|
2 | / wasmtime::component::bindgen!({
3 | | path: "./wit",
4 | | world: "w",
5 | | named_imports: {
6 | | "impo:impo/my-itf@1.2.3": String,
7 | | },
8 | | });
| |______^ expected one of `;` or `{`
Tested with Cargo 1.97.1 and Cargo 1.99.0-nightly.
I am not sure if I am doing something wrong but it seems like this could be an issue with named_imports bindgen?
(I tried to see the expansion of the macro so I could share that, but I wasn't able to get it, sorry.)
When I try to use
wasmtime::component::bindgen's newnamed_importsoption on an interface with a hyphen in it, I get an error.A repro case is here: https://github.com/itowlson/implements-hyphen-test
The first commit in the repo defines an interface named
myitfand bindgens a host for it, with anamed_importsfor themyitfinterface.The second commit changes the interface name to
my-itfwith a hyphen (no other changes except propagating the name change). The bindgen now fails with the error:Tested with Cargo 1.97.1 and Cargo 1.99.0-nightly.
I am not sure if I am doing something wrong but it seems like this could be an issue with
named_importsbindgen?(I tried to see the expansion of the macro so I could share that, but I wasn't able to get it, sorry.)