Conversation
lucic71
marked this pull request as draft
September 14, 2026 13:02
Contributor
Author
|
Depends on #362 |
Contributor
Author
|
I will close this and split this PR into multiple ones. The converter is fine, but the tests fail because of library differences. The STL between my local machine and ubuntu/macos is different. The STL in the runners forces the instantiation of move constructors that my local library does not force. Because of this, in the runners there are extra move constructors that are not present in the generated code on my machine. For example: struct S { int a; }
std::vector<S> v;
// in the runner's library, this forces a move constructor on S that my library does not have
v.erase(...);Even if I update my library to be on par with ubuntu, the macos will still fail. So I will translate all move constructors from all user defined structs, even if they are not used in the code. |
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.
This PR translates move constructors (defaulted or implicit or user written) as ordinary constructors:
fn S_pmutS(_a0: *mut S) -> Self. Defaulted and implicit ones are first synthesized by Sema.Some notes about the implementation:
std::mem::takewhich is wrong if the argument of the rule has a user defined move constructor. I will solve this in a future PR (Rewritestd::mem::takein rules for records with user-defined move constructor #365) where I will rewritestd::mem::taketo use the move constructor if the argument has one.