Skip to content

librustc: Make sure to run destructors in the right order when matching on moved value. #15442

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
wants to merge 1 commit into from

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Jul 5, 2014

Inadvertently changed the order in which destructors ran in certain cases with #15076.

Fixes #15438.



// Test to make sure the destructors run in the right order,
// which is: matched, inner, outer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this test actually verify that? It seems like you'd need some state in X to track which value is which, or else you'll end up with the same output in ORDER regardless of the order of destruction.

bors added a commit that referenced this pull request Jul 5, 2014
Inadvertently changed the order in which destructors ran in certain cases with #15076.

Fixes #15438.
@bors bors closed this Jul 5, 2014
@luqmana luqmana deleted the odp branch July 5, 2014 18:10
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.

Values moved in a match get dropped too late
4 participants