Add a check for move constructibility when formatting ADTs for CrubitAbiType::Transmute.#678
Open
copybara-service[bot] wants to merge 1 commit intomainfrom
Open
Add a check for move constructibility when formatting ADTs for CrubitAbiType::Transmute.#678copybara-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. |
…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
1592fde to
c76cd81
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.
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.