Stream: git-wasmtime

Topic: wasmtime / issue #14830 bindgen! output for map<K, V> doe...


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

jrandolf opened issue #14830:

bindgen! emits std::collections::HashMap<K, V> for map<K, V>, but Wasmtime only implements ComponentType/Lift/Lower for the HashMap behind its internal hash_map alias, which is hashbrown::HashMap when wasmtime's std feature is off. So any WIT using map fails to compile with, for example:

wasmtime = { version = "...", default-features = false, features = ["runtime", "component-model"] }
wasmtime::component::bindgen!({
    inline: "package a:b; interface i { f: func(m: map<string, u32>); } world w { import i; }",
});
error[E0277]: the trait `ComponentType` is not implemented for `HashMap<String, u32>`

The generated path also doesn't go through wasmtime_crate/__internal like Vec and String do, so it doesn't work from #![no_std] crates either. The existing codegen_no_std.rs test doesn't catch this since it re-adds extern crate std and builds wasmtime with default features.

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

alexcrichton added the wasm-proposal:component-model-map label to Issue #14830.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 22 2026 at 20:31):

fitzgen closed issue #14830:

bindgen! emits std::collections::HashMap<K, V> for map<K, V>, but Wasmtime only implements ComponentType/Lift/Lower for the HashMap behind its internal hash_map alias, which is hashbrown::HashMap when wasmtime's std feature is off. So any WIT using map fails to compile with, for example:

wasmtime = { version = "...", default-features = false, features = ["runtime", "component-model"] }
wasmtime::component::bindgen!({
    inline: "package a:b; interface i { f: func(m: map<string, u32>); } world w { import i; }",
});
error[E0277]: the trait `ComponentType` is not implemented for `HashMap<String, u32>`

The generated path also doesn't go through wasmtime_crate/__internal like Vec and String do, so it doesn't work from #![no_std] crates either. The existing codegen_no_std.rs test doesn't catch this since it re-adds extern crate std and builds wasmtime with default features.


Last updated: Oct 31 2026 at 23:03 UTC