anlavandier opened issue #11985:
Test Case
wasmtime = { version = "38", default-features = false, features = ["runtime", "component-model", "async"] }use wasmtime::component::bindgen; bindgen!({ world: "bar", inline: " package example:example; interface api { foo: func(); } world bar { import api; } ", imports: { "example:example/api/foo": async, } }); fn main () { }This code compiles with the latest released version of wasmtime (38.0.3) but doesn't when using
main, (29f2a1ca66c849a2d2e533a2df87c221daa8e2de at time of testing). The error is:error: unused `imports` rules found: ["\"example:example/api/foo\": FunctionFlags(ASYNC)"] --> src/main.rs:3:1 | 3 | / bindgen!({ 4 | | world: "bar", 5 | | inline: " 6 | | package example:example; ... | 19 | | }); | |__^ | = note: this error originates in the macro `bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)
anlavandier added the bug label to Issue #11985.
anlavandier edited issue #11985:
Test Case
wasmtime = { version = "38", default-features = false, features = ["runtime", "component-model", "async"] }use wasmtime::component::bindgen; bindgen!({ world: "bar", inline: " package example:example; interface api { foo: func(); } world bar { import api; } ", imports: { "example:example/api/foo": async, } }); fn main () { }This code compiles with the latest released version of wasmtime (38.0.3) but doesn't when using
main, (29f2a1ca66c849a2d2e533a2df87c221daa8e2de at time of testing). The error is:error: unused `imports` rules found: ["\"example:example/api/foo\": FunctionFlags(ASYNC)"] --> src/main.rs:3:1 | 3 | / bindgen!({ 4 | | world: "bar", 5 | | inline: " 6 | | package example:example; ... | 19 | | }); | |__^ | = note: this error originates in the macro `bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)
alexcrichton closed issue #11985:
Test Case
wasmtime = { version = "38", default-features = false, features = ["runtime", "component-model", "async"] }use wasmtime::component::bindgen; bindgen!({ world: "bar", inline: " package example:example; interface api { foo: func(); } world bar { import api; } ", imports: { "example:example/api/foo": async, } }); fn main () { }This code compiles with the latest released version of wasmtime (38.0.3) but doesn't when using
main, (29f2a1ca66c849a2d2e533a2df87c221daa8e2de at time of testing). The error is:error: unused `imports` rules found: ["\"example:example/api/foo\": FunctionFlags(ASYNC)"] --> src/main.rs:3:1 | 3 | / bindgen!({ 4 | | world: "bar", 5 | | inline: " 6 | | package example:example; ... | 19 | | }); | |__^ | = note: this error originates in the macro `bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)
alexcrichton commented on issue #11985:
Thanks for the report! I believe you're seeing the impact of https://github.com/bytecodealliance/wasmtime/pull/11947, which is an intentional change, so I'm going to close this. We'll be sure to call this out in the release notes for 39.0.0, however.
Last updated: Dec 06 2025 at 06:05 UTC