Skip to content

Support generic parameters in cpp_layout_equivalent#1093

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_922308817
Open

Support generic parameters in cpp_layout_equivalent#1093
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_922308817

Conversation

@copybara-service
Copy link
Copy Markdown

Support generic parameters in cpp_layout_equivalent

This change adds support for generic parameters to crubit_annotate::cpp_layout_equivalent in cpp_api_from_rust. This allows mapping Rust APIs that use generic types like cc_std::unique_ptr and cc_std::optional back into C++ by building on the existing layout_equivalent support.

  • Relaxed pointer restrictions for cpp_layout_equivalent in format_type.rs and generate_function_thunk.rs.
  • Added support for generic parameters in format_type.rs for Legacy types.
  • Fixed parameter conversion in thunks to read from pointer for non-pointers.
  • Added a test case in bridging directory.

This change adds support for generic parameters to `crubit_annotate::cpp_layout_equivalent` in `cpp_api_from_rust`. This allows mapping Rust APIs that use generic types like `cc_std::unique_ptr` and `cc_std::optional` back into C++ by building on the existing `layout_equivalent` support.

- Relaxed pointer restrictions for `cpp_layout_equivalent` in `format_type.rs` and `generate_function_thunk.rs`.
- Added support for generic parameters in `format_type.rs` for `Legacy` types.
- Fixed parameter conversion in thunks to read from pointer for non-pointers.
- Added a test case in `bridging` directory.

PiperOrigin-RevId: 922308817
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.

1 participant