Stream: git-wasmtime

Topic: wasmtime / PR #14927 Add a `map_type` option to `bindgen!...


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

jrandolf opened PR #14927 from jrandolf:bindgen-map-type-option to bytecodealliance:main:

This builds on #14870, so only the last commit is new here.

This adds a map_type option to bindgen! to choose the Rust type used for WIT maps, such as map_type: std::collections::HashMap or map_type: indexmap::IndexMap. It mirrors the guest-side wit-bindgen option, including its BTreeMap default (see the discussion on #14837). BTreeMap is available without std, so the generated code no longer depends on the features Wasmtime is built with, which fixes #14830. It also makes additional_derives such as Hash and Ord work for records containing maps.

This changes the signatures generated for maps, which are only usable with the component model's map feature, which is off by default.

Closes #14830
Closes #14832

<details>
<summary>LLM summary of the changes</summary>

Option (component-macro/src/bindgen.rs, wit-bindgen)

Docs

The bindgen! docs list map_type's options: BTreeMap (the default), std::collections::HashMap and indexmap::IndexMap.

Tests

</details>

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

jrandolf removed the review request for wasmtime-core-reviewers from PR #14927.

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

jrandolf requested wasmtime-core-reviewers for a review on PR #14927.

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

jrandolf requested dicej for a review on PR #14927.

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

jrandolf removed the review request for wasmtime-default-reviewers from PR #14927.

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

jrandolf requested wasmtime-default-reviewers for a review on PR #14927.

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

jrandolf requested fitzgen for a review on PR #14927.

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

github-actions[bot] added the label wasmtime:api on PR #14927.

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

:thumbs_up: fitzgen submitted PR review:

Looks reasonable to me, thanks

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

fitzgen added PR #14927 Add a map_type option to bindgen!, defaulting to BTreeMap to the merge queue

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

fitzgen removed PR #14927 Add a map_type option to bindgen!, defaulting to BTreeMap from the merge queue

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

:check: fitzgen merged PR #14927.


Last updated: Oct 31 2026 at 23:03 UTC