Skip to content

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
Contributor

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
Contributor

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