Skip to content

Add a check for move constructibility when formatting ADTs for CrubitAbiType::Transmute.#678

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

Add a check for move constructibility when formatting ADTs for CrubitAbiType::Transmute.#678
copybara-service[bot] wants to merge 1 commit intomainfrom
test_883167034

Conversation

@copybara-service
Copy link

Add a check for move constructibility when formatting ADTs for CrubitAbiType::Transmute.

When determining if an ADT can be represented as CrubitAbiType::Transmute, we must ensure it has a move constructor and assignment operator. The generated C++ move constructibility is a property of the ADT's definition, not a specific instantiation. Therefore, we call db.has_move_ctor_and_assignment_operator with the ADT's DefId and its identity type (tcx.type_of(adt.did()).instantiate_identity()), mirroring how the C++ bindings are generated in lib.rs.

@google-cla
Copy link

google-cla bot commented Mar 13, 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.

…AbiType::Transmute.

When determining if an ADT can be represented as CrubitAbiType::Transmute, we must ensure it has a move constructor and assignment operator. The generated C++ move constructibility is a property of the ADT's definition, not a specific instantiation. Therefore, we call db.has_move_ctor_and_assignment_operator with the ADT's DefId and its identity type (tcx.type_of(adt.did()).instantiate_identity()), mirroring how the C++ bindings are generated in lib.rs.

PiperOrigin-RevId: 883167034
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