Skip to content
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

Fix the order in which struct fields drop #16493

Merged
merged 1 commit into from
Aug 16, 2014

Conversation

lilyball
Copy link
Contributor

When a struct implements Drop, its fields should still drop in
declaration order (just as they do when the struct does not implement
Drop).

Fixes #16492.

@eddyb
Copy link
Member

eddyb commented Aug 14, 2014

cc @pnkfelix

When a struct implements Drop, its fields should still drop in
declaration order (just as they do when the struct does not implement
Drop).

Fixes rust-lang#16492.
bors added a commit that referenced this pull request Aug 15, 2014
When a struct implements Drop, its fields should still drop in
declaration order (just as they do when the struct does not implement
Drop).

Fixes #16492.
@bors bors closed this Aug 16, 2014
@bors bors merged commit b517b42 into rust-lang:master Aug 16, 2014
@lilyball lilyball deleted the fix_drop_field_order branch August 16, 2014 01:10
@pnkfelix
Copy link
Member

I just realized that while this did made things internally consistent, it may be better for us to go in the other direction, and make drop of a struct (in all contexts) drop the fields in reverse declaration order.

@lilyball
Copy link
Contributor Author

@pnkfelix That's a good point.

@pnkfelix
Copy link
Member

Filed as #16661

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.

Drop impl on type reverses order of field destruction
4 participants