Stream: git-wasmtime

Topic: wasmtime / PR #12212 Additional matching


view this post on Zulip Wasmtime GitHub notifications bot (Dec 22 2025 at 23:30):

BoilingFusion opened PR #12212 from BoilingFusion:additional_matching to bytecodealliance:main:

Add Add matches function to all types structs

closes #12193

For the matching functions it follows these specs.

Adds:

view this post on Zulip Wasmtime GitHub notifications bot (Dec 22 2025 at 23:30):

BoilingFusion requested fitzgen for a review on PR #12212.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 22 2025 at 23:30):

BoilingFusion requested wasmtime-core-reviewers for a review on PR #12212.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 22 2025 at 23:36):

BoilingFusion commented on PR #12212:

I think its correct.
Although things did turn out a little bit less trivial than expected. Luckly the spec was pretty clear on when types matched.
Some extra focus on reviewing TagTypes would be helpfull since the spec for TagTypes matching was more complex than for the others.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 23 2025 at 16:01):

alexcrichton commented on PR #12212:

This looks like it's largely a duplication of this file, would it be possible to avoid reimplementing that file and using the implementations there instead? Reusing an implementation would reduce the need for tests, and otherwise this will need tests as opposed to just adding the methods.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 23 2025 at 21:18):

BoilingFusion commented on PR #12212:

Im afraid that file implements the methods for Global and Memory, etc instead of for GlobalType and MemoryType etc.

Its kind of hard to use these since you would first have to create a Global from the GlobalType to do the comparison. The other way around should be more natural.

What would be the appropriate place to add the tests?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 15:05):

alexcrichton commented on PR #12212:

The externally-facing Wasmtime types should, I believe, carry the internal types within them (or somewhere within them) which should, I believe, be suitable for passing to that location. It's true that it's perhaps not quite as easy, but to me it'd be worth not having duplication.

Tests can go in tests/all/*.rs in an appropriate file or in a #[test] at the end of a file.


Last updated: Jan 09 2026 at 13:15 UTC