Skip to content

Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs#756

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_888843585
Open

Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs#756
copybara-service[bot] wants to merge 1 commit intomainfrom
test_888843585

Conversation

@copybara-service
Copy link

Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs

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.

@google-cla
Copy link

google-cla bot commented Mar 25, 2026

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants