itowlson opened issue #14090:
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: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_importsbindgen?(I tried to see the expansion of the macro so I could share that, but I wasn't able to get it, sorry.)
alexcrichton closed issue #14090:
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: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_importsbindgen?(I tried to see the expansion of the macro so I could share that, but I wasn't able to get it, sorry.)
Last updated: Aug 30 2026 at 10:08 UTC