Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs#756
Open
copybara-service[bot] wants to merge 1 commit intomainfrom
Open
Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs#756copybara-service[bot] wants to merge 1 commit intomainfrom
copybara-service[bot] wants to merge 1 commit intomainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
f819150 to
61d8612
Compare
Currently, `c9::internal::rust::EncodeResultInCrubitBuffer` requires the Crubit ABI type to be default constructible. This breaks for complex ABI types like `rs_std::DynCallable` which requires initialization arguments. This change delegates the ABI instantiation to the caller (either the Rust binding generator or the `CoCrubitAbi` fallback constructor). Because some ABI types are not "structural types" in C++20 and cannot be used as template arguments directly, we pass a closure type (`AbiFactory`) to `StartCoroutineFromRust` that constructs the ABI upon invocation. PiperOrigin-RevId: 888843585
61d8612 to
e537430
Compare
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.
Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs
Currently,
c9::internal::rust::EncodeResultInCrubitBufferrequires the Crubit ABI type to be default constructible. This breaks for complex ABI types likers_std::DynCallablewhich requires initialization arguments.This change delegates the ABI instantiation to the caller (either the Rust binding generator or the
CoCrubitAbifallback constructor). Because some ABI types are not "structural types" in C++20 and cannot be used as template arguments directly, we pass a closure type (AbiFactory) toStartCoroutineFromRustthat constructs the ABI upon invocation.