Skip to content

When output is ignored, struct update could cause incorrect moves #7261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nikomatsakis opened this issue Jun 20, 2013 · 4 comments · Fixed by #16511
Closed

When output is ignored, struct update could cause incorrect moves #7261

nikomatsakis opened this issue Jun 20, 2013 · 4 comments · Fixed by #16511
Labels
P-medium Medium priority

Comments

@nikomatsakis
Copy link
Contributor

The current translation for struct update in the case of ignore looks incorrect. It should only move those fields that are not specified manually. This can mean the difference between moving the base as a whole and not. Probably the easiest thing to do is to create an alloca, use the same code as the normal path, and just drop the alloca afterwards.

@nikomatsakis
Copy link
Contributor Author

See FIXME.

@metajack
Copy link
Contributor

metajack commented Aug 8, 2013

visiting for triage. nominating for production ready.

@catamorphism
Copy link
Contributor

Accepted for production-ready

@flaper87
Copy link
Contributor

visting for triage, still relevant.

FYI, the module in question is rustc::middle::trans::expr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-medium Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants