feat(c): add map type support#1611
Merged
alexcrichton merged 2 commits intoJun 2, 2026
Merged
Conversation
yordis
commented
May 13, 2026
alexcrichton
reviewed
Jun 1, 2026
Member
alexcrichton
left a comment
There was a problem hiding this comment.
Thanks again for this! This all looks reasonable to me and I'd be ok landign this as-is without the map.wit test comment (that seems like more of a transient comment)
797f79f to
a30daa3
Compare
The flat { entry_t *ptr; size_t len; } shape matches the canonical
ABI's lowered layout for map<K, V>, so reusing the list fast-path
keeps the FFI boundary copy-free and brings C to parity with the
Rust, Go, MoonBit, and C# backends that already ship map support.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Covers the C-side lower/lift boundary behaviorally against the existing Rust/Go/MoonBit suite, so future ABI changes that compile cleanly cannot silently regress map round-trips. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
a30daa3 to
7d31ed4
Compare
alexcrichton
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
{ entry_t *ptr; size_t len; }representation matches the canonical ABI's lowered layout formap<K, V>exactly, so reusing the existing list lower/lift fast-path keeps the FFI boundary copy-free and the implementation stays consistent withcrates/c's existing list/string idiom.TypeDefKind::Map(..) => todo!()arms fromcrates/cand themap.witentry fromcrates/test/src/c.rs'sshould_fail_verifyskip list.