Stream: git-wasmtime

Topic: wasmtime / issue #12591 wasmtime::component::bindgen! gen...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 21:19):

NickLarsenNZ opened issue #12591:

When I expand the code generated by this macro:

wasmtime::component::bindgen!({
    world: "plugin",
    path: "../wit",
});

There appears to be additional / ending up in the actual doc comments:

#[doc = "/ Auto-generated bindings for a pre-instantiated version of a"]
#[doc = "/ component which implements the world `plugin`."]
#[doc = "/"]
#[doc = "/ This structure is created through [`PluginPre::new`] which"]
#[doc = "/ takes a [`InstancePre`](wasmtime::component::InstancePre) that"]
#[doc = "/ has been created through a [`Linker`](wasmtime::component::Linker)."]
#[doc = "/"]
#[doc = "/ For more information see [`Plugin`] as well."]
pub struct PluginPre<T: 'static> {
    instance_pre: wasmtime::component::InstancePre<T>,
    indices: PluginIndices,
}

view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 21:21):

NickLarsenNZ edited issue #12591:

With:

wasmtime = { version = "41.0.3", features = ["component-model"] }

When I expand the code generated by this macro:

wasmtime::component::bindgen!({
    world: "plugin",
    path: "../wit",
});

There appears to be additional / ending up in the actual doc comments:

#[doc = "/ Auto-generated bindings for a pre-instantiated version of a"]
#[doc = "/ component which implements the world `plugin`."]
#[doc = "/"]
#[doc = "/ This structure is created through [`PluginPre::new`] which"]
#[doc = "/ takes a [`InstancePre`](wasmtime::component::InstancePre) that"]
#[doc = "/ has been created through a [`Linker`](wasmtime::component::Linker)."]
#[doc = "/"]
#[doc = "/ For more information see [`Plugin`] as well."]
pub struct PluginPre<T: 'static> {
    instance_pre: wasmtime::component::InstancePre<T>,
    indices: PluginIndices,
}

view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 21:29):

NickLarsenNZ commented on issue #12591:

The docs in the template appear to be correct:

https://github.com/bytecodealliance/wasmtime/blob/bda02c19ef1f89d2abc25eb5783c36fbf9f8c7e9/crates/wit-bindgen/src/lib.rs#L749-L760

view this post on Zulip Wasmtime GitHub notifications bot (Feb 13 2026 at 22:32):

pchickey commented on issue #12591:

To check whether this is an artifact of wasmtime's bindgen or your code expansion, can you try setting WASMTIME_DEBUG_BINDGEN=1 in your environment? That will have bindgen write a separate .rs file in OUT_DIR and include! that file in place, which sometimes has a better experience for debugging because errors get line numbers.

If that resolves your issue, then what you are seeing is down to whatever mechanism you are using to expand the macro.


Last updated: Feb 24 2026 at 04:36 UTC