Repository navigation
Conversation
Quest-Claim: 503757f4399e30a5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # ffi/fixtures/reject/expected.txt # ffi/fixtures/reject/src/lib.rs # ffi/src/abi.rs # quest/m1/ffi-export/README.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate callback tables with the types Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 10, 2026 22:18
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.

Finishes quest/m1/ffi-export/names.md: no name clash fails an export any more. Each language keeps apart only the names that clash in it, and renames nothing in other languages. C names stay Rust's wherever they don't clash.
Summary
abi.rs): every C name is still registered, but each claim now records the item it belongs to. A clash renames items until no clash is left:_at every split after the segments they share, soaudio::encoder_finishandaudio_encoder::finishbecomeapi_clash_audio__encoder_finishandapi_clash_audio_encoder__finish. One whose remaining path is a single segment keeps its name, the same ruleapartuses for Pascal case._, as do the names made from it. This covers a clash with a runtime name, with a name made from a type (a methodfreebeside<type>_free, an inherentto_stringbesideDisplay's), or between two tuples (((u8, u16), u32)and((u8, u16, u32),)). The keeper comes first by rank (the runtime, then names made from an item, then items' own names), then by what claims it.Export::namedcarries the unrenamed C name, which the other generators name members by. So a C-only rename (Store_free_) staysfree()in Kotlin, Python, Swift, Go, and Dart. C++ keeps naming by C names, as its README says.classes): afterapartand Go's module segment (moq-dev/rust2#683), names that still match go throughabi::unique. A name that matches by case (Tone/TONE), or that the runtime or a range's class takes, gets a trailing_. The type whose last segment is already in Pascal case keeps the plain name, then the rest go by C name. Types are registered before any other top-level name, so they win.abi::claimadds a trailing_where a type, the runtime, or an earlier name already has the name. This applies in Kotlin, Python, Swift (by full name), Dart, and Go._in Swift, Go, Dart, Kotlin, and Python.distinctstays as an internal check, and its message no longer tells the author to rename.<prefix>_dartgains a_while any C name of the export starts with it. Before, such a C name was refused.clashandCancelled. They cover types apart only by case, a method named as its field, inherentto_stringbesideDisplay, methodsfreeandclose, a name Dart's runtime declares, theaudiosplit, and the nested tuples. All 7 languages call them and match the native transcript. The reject fixture drops its two clash cases.Public API
Breaking only for names that failed to export before. Every name that exported before is unchanged, with two exceptions:
RangeU64) now takes a_.<prefix>_dart_. Before, that export failed.Choices made without asking
__(the quest's recommendation). C++ reserves identifiers containing__, and the C++ wrapper both includes and re-declares these names. GCC and Clang accept them under-Wall -Wextra -pedantic, but strictly this is undefined behavior. The alternative is a plain trailing_for C too, which hides where the paths split. I kept__because only clashing names ever get it._instead of a split_.clashAudioEncoderFinishandclashAudioEncoderFinish_: those generators name functions from the full joined path, soapart's split would need a second naming path for functions.classes. Go shares that code, so a Go type named like a range class also gets a_, even though Go keeps ranges inrt.String,GoString,Equal, orError(on an error) gets a trailing_, so the method keeps the name its interface needs.Remaining edges, not reachable from moq
Aanda, which needs#[allow(non_camel_case_types)]. Renaming the enum cannot separate its own variants.Suggested follow-ups
Caused by
No single PR. The generators refused clashes by design from the start.
Models
Size: M
Implementer: Claude Code, Opus 5.5, medium effort
(Written by Claude Opus 5.5 with medium)