BoilingFusion opened PR #12212 from BoilingFusion:additional_matching to bytecodealliance:main:
Add Add
matchesfunction to all types structscloses #12193
For the
matchingfunctions it follows these specs.Adds:
ExternType::matchesExternType::eqGlobalType::matchesGlobalType::eqTableType::matchesTableType::eqMemoryType::matchesMemoryType::eqTagType::matchesTagType::eq
BoilingFusion requested fitzgen for a review on PR #12212.
BoilingFusion requested wasmtime-core-reviewers for a review on PR #12212.
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 reviewingTagTypeswould be helpfull since the spec forTagTypesmatching was more complex than for the others.
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.
BoilingFusion commented on PR #12212:
Im afraid that file implements the methods for
GlobalandMemory, etc instead of forGlobalTypeandMemoryTypeetc.Its kind of hard to use these since you would first have to create a
Globalfrom theGlobalTypeto do the comparison. The other way around should be more natural.What would be the appropriate place to add the tests?
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/*.rsin an appropriate file or in a#[test]at the end of a file.
Last updated: Jan 09 2026 at 13:15 UTC